File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
validation-test/Sema/type_checker_crashers_fixed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -4224,7 +4224,7 @@ struct TypeSimplifier {
4224
4224
4225
4225
auto result = conformance.getAssociatedType (
4226
4226
lookupBaseType, assocType->getDeclaredInterfaceType ());
4227
- if (!result->hasError ())
4227
+ if (result && !result->hasError ())
4228
4228
return result;
4229
4229
}
4230
4230
Original file line number Diff line number Diff line change
1
+ // RUN: not %target-swift-frontend %s -typecheck
2
+
3
+ public protocol P1 {
4
+ associatedtype A
5
+
6
+ init ( a: A )
7
+ }
8
+
9
+ public protocol P2 : P1 {
10
+ associatedtype B
11
+
12
+ init ( )
13
+ }
14
+
15
+ extension P2 where A == B {
16
+ public init ( ) { fatalError ( ) }
17
+ public init ( a: B ) { fatalError ( ) }
18
+ }
19
+
20
+ public protocol P3 : P2 {
21
+ associatedtype B = Self
22
+
23
+ static var y : B { get }
24
+ }
25
+
26
+ public struct S : P3 {
27
+ public static let x = S ( c: 1 )
28
+ public static let y = S ( c: 2 )
29
+
30
+ public init ( c: Int ) { }
31
+ }
You can’t perform that action at this time.
0 commit comments