Files
swift-mirror/test/Constraints/rdar45415874.swift
Pavel Yaskevich 4197cfd649 [ConstraintSystem] Properly cache type for literal initialization coercions
Since original implicit coercion expression is preserved in AST
it needs to have its simplified type cached in the constraint
system in order for AST to get the correct type when solution
is fully applied.

Resolves: rdar://problem/45415874
2018-10-21 20:12:38 -07:00

16 lines
252 B
Swift

// RUN: %target-typecheck-verify-swift
final class A<T> {
init(_: T) {}
}
extension A: ExpressibleByNilLiteral where T: ExpressibleByNilLiteral {
convenience init(nilLiteral: ()) {
self.init(nil)
}
}
struct B {
var foo: A<B?> = A(nil)
}