File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1750,6 +1750,9 @@ void ConstraintSystem::sortDesignatedTypes(
1750
1750
1751
1751
for (auto *protocol : argInfo.getLiteralProtocols ()) {
1752
1752
auto defaultType = TC.getDefaultType (protocol, DC);
1753
+ // ExpressibleByNilLiteral does not have a default type.
1754
+ if (!defaultType)
1755
+ continue ;
1753
1756
auto *nominal = defaultType->getAnyNominal ();
1754
1757
for (size_t i = nextType + 1 ; i < nominalTypes.size (); ++i) {
1755
1758
if (nominal == nominalTypes[i]) {
Original file line number Diff line number Diff line change
1
+ // RUN: %target-typecheck-verify-swift -swift-version 5 -solver-enable-operator-designated-types -solver-disable-shrink -disable-constraint-solver-performance-hacks
2
+
3
+ func test( _ x: Int ) -> Int {
4
+ return x + nil
5
+ // expected-error@-1 {{cannot convert value of type 'Int' to expected argument type '_.Stride'}}
6
+ }
You can’t perform that action at this time.
0 commit comments