Skip to content

Commit 92a5c00

Browse files
committed
[test] Add a few more known type-checker crashers
1 parent d3abee7 commit 92a5c00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+209
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::constraints::FunctionTypeMismatch::FunctionTypeMismatch(swift::constraints::Solution const&, swift::ContextualTypePurpose, swift::Type, swift::Type, llvm::ArrayRef<unsigned int>, swift::constraints::ConstraintLocator*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
func a< each b >->(Int, repeat each b)Float= a(
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"signature":"swift::ExtensionDecl::getExtendedNominal() const"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
extension a {}
4+
func b < >>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// {"signature":"swift::constraints::SolverTrail::~SolverTrail()"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
enum a< b { case c(}
4+
func d< b >(b->a< b >) d(a< e >.c let a
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::rewriting::PropertyMap::addSuperclassProperty(swift::rewriting::Term, swift::rewriting::Symbol, unsigned int)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
class a < b class c : a func d < b where b : a<Int>, b : c
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"lookupReplacedDecl(swift::DeclNameRef, swift::DeclAttribute const*, swift::ValueDecl const*, llvm::SmallVectorImpl<swift::ValueDecl*>&)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
{ @_dynamicReplacement(for: ) func a
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"signature":"(anonymous namespace)::ExprWalker::walkToExprPost(swift::Expr*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
func a {
4+
{
5+
\ b() a
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::constraints::ConstraintSystem::setClosureType(swift::ClosureExpr const*, swift::FunctionType*)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
protocol b let c = {(a : b)in switch a{case.d {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// {"signature":"swift::InFlightSubstitution::lookupConformance(swift::Type, swift::ProtocolDecl*, unsigned int)"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
typealias a<b, c, d> = () struct e < each b {
4+
typealias f<each c, d> = (repeat a<each b, each c, d>)struct g < each c {
5+
typealias h< each d > = (repeat f< repeat each c, each d >
6+
struct i typealias j< each d > =
7+
e< i >.g< repeat each b >.h< repeat each d >
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// {"signature":"swift::TypeBase::getOptionalObjectType()"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
enum a { b } {
4+
let:
5+
String->a = a.b
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// {"signature":"swift::constraints::ConstraintLocator::isKeyPathMemberComponent() const"}
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
\_(error)

0 commit comments

Comments
 (0)