File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
lib/SILOptimizer/SILCombiner
validation-test/compiler_crashers_2_fixed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -907,7 +907,7 @@ SILCombiner::buildConcreteOpenedExistentialInfoFromSoleConformingType(
907
907
(archetypeTy->getConformsTo ().size () == 1 )) {
908
908
PD = archetypeTy->getConformsTo ()[0 ];
909
909
} else if (ArgType.isExistentialType () && !ArgType.isAnyObject () &&
910
- !SwiftArgType->isAny ()) {
910
+ !SwiftArgType->isAny () && SwiftArgType-> getAnyNominal () ) {
911
911
PD = dyn_cast<ProtocolDecl>(SwiftArgType->getAnyNominal ());
912
912
}
913
913
}
Original file line number Diff line number Diff line change
1
+ // This source file is part of the Swift.org open source project
2
+ // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
3
+ // Licensed under Apache License v2.0 with Runtime Library Exception
4
+ //
5
+ // See https://swift.org/LICENSE.txt for license information
6
+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
7
+
8
+ // RUN: not %target-swift-frontend %s -O -whole-module-optimization
9
+
10
+ class ClassA < T> { }
11
+ protocol ProtocolA { }
12
+
13
+ class MainClass < H> {
14
+ init ( x: ClassA < H > & ProtocolA ) { }
15
+ }
16
+
17
+ final class ClassB : ClassA < String > { }
18
+ extension ClassB : ProtocolA { }
19
+
20
+ _ = MainClass ( x: ClassB ( ) )
You can’t perform that action at this time.
0 commit comments