We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9cfd3c4 + d141935 commit a556d39Copy full SHA for a556d39
lib/Sema/CSApply.cpp
@@ -3599,6 +3599,7 @@ namespace {
3599
3600
literalInit->setImplicit(false);
3601
3602
+ cs.setType(expr, toType);
3603
// Keep the coercion around, because it contains the source range
3604
// for the original constructor call.
3605
return expr;
test/Constraints/rdar45415874.swift
@@ -0,0 +1,15 @@
1
+// RUN: %target-typecheck-verify-swift
2
+
3
+final class A<T> {
4
+ init(_: T) {}
5
+}
6
7
+extension A: ExpressibleByNilLiteral where T: ExpressibleByNilLiteral {
8
+ convenience init(nilLiteral: ()) {
9
+ self.init(nil)
10
+ }
11
12
13
+struct B {
14
+ var foo: A<B?> = A(nil)
15
0 commit comments