We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 6027248 + 56e13fc commit 821a5a6Copy full SHA for 821a5a6
lib/Sema/CSGen.cpp
@@ -752,7 +752,10 @@ namespace {
752
}
753
754
Type paramTy = fnTy->getInput();
755
- auto paramTupleTy = paramTy->castTo<TupleType>();
+ auto paramTupleTy = paramTy->getAs<TupleType>();
756
+ if (!paramTupleTy || paramTupleTy->getNumElements() != 2)
757
+ return false;
758
+
759
auto firstParamTy = paramTupleTy->getElement(0).getType();
760
auto secondParamTy = paramTupleTy->getElement(1).getType();
761
validation-test/compiler_crashers_2_fixed/0036-rdar23719809.swift
@@ -0,0 +1,12 @@
1
+// RUN: not %target-swift-frontend %s -parse
2
3
+// rdar://problem/23719809&23720006
4
5
+func ~=() {}
6
+func ~=(_: Int) {}
7
+func ~=(_: () -> ()) {}
8
9
+switch 0 {
10
+case 0:
11
+ break
12
+}
0 commit comments