Skip to content

Commit 0c553ca

Browse files
committed
[test] Add some not-yet-crashing crashers
These would crash with an assertion I'm planning on adding, make sure I fix them before adding the assert.
1 parent ebd97bb commit 0c553ca

File tree

5 files changed

+36
-0
lines changed

5 files changed

+36
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// {"kind":"typecheck","original":"e679747c","signature":"swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, swift::Type, swift::PatternBindingDecl*, unsigned int, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>)"}
2+
// RUN: not %target-swift-frontend -typecheck %s
3+
enum a<b>: Error {
4+
case c(
5+
}
6+
struct d {
7+
bar( Error? -> Void)
8+
{
9+
bar {
10+
e in
11+
return if let a<Int>.c(f) = e {
12+
f
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"kind":"typecheck","original":"deecafdd","signature":"swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, swift::Type, swift::PatternBindingDecl*, unsigned int, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>)"}
2+
// RUN: not %target-swift-frontend -typecheck %s
3+
return {
4+
lazy var a = <#expression#>
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// {"kind":"typecheck","original":"1309b52b","signature":"swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, swift::Type, swift::PatternBindingDecl*, unsigned int, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>)"}
2+
// RUN: not %target-swift-frontend -typecheck %s
3+
{
4+
let a = 0.0
5+
switch a {
6+
case let !b where b:
7+
}
8+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// {"kind":"typecheck","original":"22c204bc","signature":"swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, swift::Type, swift::PatternBindingDecl*, unsigned int, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>)"}
2+
// RUN: not %target-swift-frontend -typecheck %s
3+
struct a: ExpressibleByIntegerLiteral
4+
func *** (a , a )
5+
}
6+
{
7+
let b = 3 *** 4
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"kind":"typecheck","original":"18f513af","signature":"swift::TypeChecker::typeCheckBinding(swift::Pattern*&, swift::Expr*&, swift::DeclContext*, swift::Type, swift::PatternBindingDecl*, unsigned int, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>)"}
2+
// RUN: not %target-swift-frontend -typecheck %s
3+
{
4+
guard let a = a "

0 commit comments

Comments
 (0)