Skip to content

Commit f0264de

Browse files
committed
Update test now that contextual type resolution is reduced to 'mapTypeIntoContext'
1 parent 27ea1d5 commit f0264de

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/Generics/generic_types.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,14 @@ struct UnsolvableInheritance2<T : U.A, U : T.A> {}
246246
enum X7<T> where X7.X : G { case X } // expected-error{{enum case 'X' is not a member type of 'X7<T>'}}
247247
// expected-error@-1{{cannot find type 'G' in scope}}
248248

249+
// Test that contextual type resolution for generic metatypes is consistent
250+
// under a same-type constraint.
249251
protocol MetatypeTypeResolutionProto {}
250252
struct X8<T> {
251253
static var property1: T.Type { T.self }
252254
static func method1() -> T.Type { T.self }
253255
}
254256
extension X8 where T == MetatypeTypeResolutionProto {
255-
// FIXME: Inconsistent contextual type resolution for generic metatypes;
256-
// should be .Protocol in both cases.
257-
static var property2: T.Type { property1 }
258-
// expected-error@-1 {{cannot convert return expression of type 'MetatypeTypeResolutionProto.Protocol' to return type 'MetatypeTypeResolutionProto.Type'}}
259-
static func method2() -> T.Type { method1() } // ok
257+
static var property2: T.Type { property1 } // ok, still .Protocol
258+
static func method2() -> T.Type { method1() } // ok, still .Protocol
260259
}

0 commit comments

Comments
 (0)