File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -1420,7 +1420,7 @@ namespace {
1420
1420
if (auto *VD = dyn_cast<VarDecl>(E->getDecl ())) {
1421
1421
knownType = CS.getTypeIfAvailable (VD);
1422
1422
if (!knownType)
1423
- knownType = VD->getInterfaceType ();
1423
+ knownType = VD->getType ();
1424
1424
1425
1425
if (knownType) {
1426
1426
assert (!knownType->isHole ());
@@ -1432,8 +1432,6 @@ namespace {
1432
1432
}
1433
1433
1434
1434
// Set the favored type for this expression to the known type.
1435
- if (knownType->hasTypeParameter ())
1436
- knownType = VD->getDeclContext ()->mapTypeIntoContext (knownType);
1437
1435
CS.setFavoredType (E, knownType.getPointer ());
1438
1436
}
1439
1437
Original file line number Diff line number Diff line change @@ -48,8 +48,7 @@ public struct S<A: P> where A.T == S<A> { // expected-error {{circular reference
48
48
// expected-error@-2 {{generic struct 'S' references itself}}
49
49
// expected-note@-3 {{while resolving type 'S<A>'}}
50
50
func f( a: A . T ) {
51
- g ( a: id ( t: a) )
52
- // expected-error@-1 {{type of expression is ambiguous without more context}}
51
+ g ( a: id ( t: a) ) // `a` has error type which is diagnosed as circular reference
53
52
_ = A . T. self
54
53
}
55
54
You can’t perform that action at this time.
0 commit comments