Skip to content

Commit 86813c7

Browse files
committed
[CS] Sink placeholder handling logic into Solution::simplifyType
Move the logic from `FailureDiagnostic::resolveType` into `Solution::simplifyType` to allow completion to use it too. While here, also handle cases where the placeholder is from a different member of the equivalence class to the generic parameter.
1 parent 53f52c4 commit 86813c7

19 files changed

+130
-94
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -96,37 +96,7 @@ Type FailureDiagnostic::getRawType(ASTNode node) const {
9696

9797
Type FailureDiagnostic::resolveType(Type rawType, bool reconstituteSugar,
9898
bool wantRValue) const {
99-
rawType = rawType.transformRec([&](Type type) -> std::optional<Type> {
100-
if (auto *typeVar = type->getAs<TypeVariableType>()) {
101-
auto resolvedType = S.simplifyType(typeVar);
102-
103-
if (!resolvedType->hasError())
104-
return resolvedType;
105-
106-
// If type variable was simplified to an unresolved pack expansion
107-
// type, let's examine its original pattern type because it could
108-
// contain type variables replaceable with their generic parameter
109-
// types.
110-
if (auto *expansion = resolvedType->getAs<PackExpansionType>()) {
111-
auto *locator = typeVar->getImpl().getLocator();
112-
auto *openedExpansionTy =
113-
locator->castLastElementTo<LocatorPathElt::PackExpansionType>()
114-
.getOpenedType();
115-
auto patternType = resolveType(openedExpansionTy->getPatternType());
116-
return PackExpansionType::get(patternType, expansion->getCountType());
117-
}
118-
119-
Type GP = typeVar->getImpl().getGenericParameter();
120-
return resolvedType->is<ErrorType>() && GP
121-
? ErrorType::get(GP)
122-
: resolvedType;
123-
}
124-
125-
if (type->isPlaceholder())
126-
return ErrorType::get(type->getASTContext());
127-
128-
return std::nullopt;
129-
});
99+
rawType = S.simplifyType(rawType);
130100

131101
if (rawType->hasElementArchetype()) {
132102
auto *env = getDC()->getGenericEnvironmentOfContext();

lib/Sema/ConstraintSystem.cpp

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1861,6 +1861,68 @@ void Solution::recordSingleArgMatchingChoice(ConstraintLocator *locator) {
18611861
MatchCallArgumentResult::forArity(1)});
18621862
}
18631863

1864+
static GenericTypeParamType *
1865+
getGenericParamForHoleTypeVar(TypeVariableType *tv, const Solution &S) {
1866+
auto getGenericParam = [](TypeVariableType *tv) -> GenericTypeParamType * {
1867+
auto *gp = tv->getImpl().getGenericParameter();
1868+
if (!gp)
1869+
return nullptr;
1870+
// Note we only consider generic parameters with underlying decls since for
1871+
// diagnostics we want something we can print, and for completion we want
1872+
// something we can extract a GenericEnvironment to produce an archetype.
1873+
return gp->getDecl() ? gp : nullptr;
1874+
};
1875+
1876+
if (auto *gp = getGenericParam(tv))
1877+
return gp;
1878+
1879+
// Sometimes we run into cases where the originator of a hole isn't for
1880+
// the generic parameter, instead it's for a member of its equivalence
1881+
// class. Handle this by looking through all the bindings to see if we have
1882+
// the same hole bound to a generic parameter type variable.
1883+
for (auto &binding : S.typeBindings) {
1884+
if (auto *hole = binding.second->getAs<PlaceholderType>()) {
1885+
if (hole->getOriginator().dyn_cast<TypeVariableType *>() == tv) {
1886+
if (auto *gp = getGenericParam(binding.first))
1887+
return gp;
1888+
}
1889+
}
1890+
}
1891+
return nullptr;
1892+
}
1893+
1894+
static Type replacePlaceholderType(PlaceholderType *placeholder,
1895+
const Solution &S) {
1896+
auto &ctx = S.getConstraintSystem().getASTContext();
1897+
auto origTy = [&]() -> Type {
1898+
auto orig = placeholder->getOriginator();
1899+
if (auto *tv = orig.dyn_cast<TypeVariableType *>())
1900+
return tv;
1901+
if (auto *dmt = orig.dyn_cast<DependentMemberType *>())
1902+
return dmt;
1903+
return Type();
1904+
}();
1905+
if (!origTy)
1906+
return ErrorType::get(ctx);
1907+
1908+
// Try replace the type variable with its original generic parameter type.
1909+
auto replacement = origTy.transformRec([&](Type ty) -> std::optional<Type> {
1910+
auto *tv = dyn_cast<TypeVariableType>(ty.getPointer());
1911+
if (!tv)
1912+
return std::nullopt;
1913+
1914+
auto *gp = getGenericParamForHoleTypeVar(tv, S);
1915+
if (!gp)
1916+
return std::nullopt;
1917+
1918+
return Type(gp);
1919+
});
1920+
// Return an ErrorType with the replacement as the original type. Note that
1921+
// if we failed to replace a type variable with a generic parameter,
1922+
// `ErrorType::get` will fold it away.
1923+
return ErrorType::get(replacement);
1924+
}
1925+
18641926
Type Solution::simplifyType(Type type, bool wantInterfaceType) const {
18651927
// If we've been asked for an interface type, start by mapping any archetypes
18661928
// out of context.
@@ -1899,7 +1961,11 @@ Type Solution::simplifyType(Type type, bool wantInterfaceType) const {
18991961
return type;
19001962

19011963
auto *typePtr = type.getPointer();
1902-
if (isa<TypeVariableType>(typePtr) || isa<PlaceholderType>(typePtr))
1964+
1965+
if (auto *placeholder = dyn_cast<PlaceholderType>(typePtr))
1966+
return replacePlaceholderType(placeholder, *this);
1967+
1968+
if (isa<TypeVariableType>(typePtr))
19031969
return ErrorType::get(ctx);
19041970

19051971
return std::nullopt;

test/Constraints/diag_missing_arg.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ func attributedInOutFunc(x: inout @convention(c) () -> Int32) {} // expected-not
1919
attributedInOutFunc() // expected-error {{missing argument for parameter 'x' in call}} {{21-21=x: &<#@convention(c) () -> Int32#>}}
2020

2121
func genericFunc1<T>(x: T) {} // expected-note * {{here}}
22-
genericFunc1() // expected-error {{missing argument for parameter 'x' in call}} {{14-14=x: <#_#>}}
22+
genericFunc1() // expected-error {{missing argument for parameter 'x' in call}} {{14-14=x: <#T#>}}
2323

2424
protocol P {}
2525
func genericFunc2<T : P>(x: T) {} // expected-note * {{here}}
26-
genericFunc2() // expected-error {{missing argument for parameter 'x' in call}} {{14-14=x: <#_#>}}
26+
genericFunc2() // expected-error {{missing argument for parameter 'x' in call}} {{14-14=x: <#T#>}}
2727

2828
typealias MyInt = Int
2929
func aliasedFunc(x: MyInt) {} // expected-note * {{here}}

test/Constraints/generics.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,8 +1040,8 @@ func test_requirement_failures_in_ambiguous_context() {
10401040
// rdar://106054263 - failed to produce a diagnostic upon generic argument mismatch
10411041
func test_mismatches_with_dependent_member_generic_arguments() {
10421042
struct Binding<T, U> {}
1043-
// expected-note@-1 {{arguments to generic parameter 'T' ('Double?' and 'Data.SomeAssociated') are expected to be equal}}
1044-
// expected-note@-2 {{arguments to generic parameter 'U' ('Int' and 'Data.SomeAssociated') are expected to be equal}}
1043+
// expected-note@-1 {{arguments to generic parameter 'T' ('Double?' and 'Data.SomeAssociated' (aka 'String')) are expected to be equal}}
1044+
// expected-note@-2 {{arguments to generic parameter 'U' ('Int' and 'Data.SomeAssociated' (aka 'String')) are expected to be equal}}
10451045

10461046
struct Data : SomeProtocol {
10471047
typealias SomeAssociated = String
@@ -1058,7 +1058,7 @@ func test_mismatches_with_dependent_member_generic_arguments() {
10581058

10591059
test2(Optional<Int>(nil), Data())
10601060
// expected-error@-1 {{cannot convert value of type 'Optional<Int>' to expected argument type 'Optional<Data.SomeAssociated>'}}
1061-
// expected-note@-2 {{arguments to generic parameter 'Wrapped' ('Int' and 'Data.SomeAssociated') are expected to be equal}}
1061+
// expected-note@-2 {{arguments to generic parameter 'Wrapped' ('Int' and 'Data.SomeAssociated' (aka 'String')) are expected to be equal}}
10621062
}
10631063

10641064
extension Dictionary where Value == Any { // expected-note {{where 'Value' = 'any P'}}

test/Constraints/pack_expansion_types.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,10 +240,10 @@ func patternInstantiationConcreteValid() {
240240

241241
func patternInstantiationConcreteInvalid() {
242242
let _: Set<Int> = patternInstantiationTupleTest1()
243-
// expected-error@-1 {{cannot convert value of type '(repeat Array<_>)' to specified type 'Set<Int>'}}
243+
// expected-error@-1 {{cannot convert value of type 'Array<_>' to specified type 'Set<Int>'}}
244244
// expected-error@-2 {{could not infer pack element #0 from context}}
245245

246-
let _: (Array<Int>, Set<String>) = patternInstantiationTupleTest1() // expected-error {{'(repeat Array<Int, _>)' is not convertible to '(Array<Int>, Set<String>)', tuples have a different number of elements}}
246+
let _: (Array<Int>, Set<String>) = patternInstantiationTupleTest1() // expected-error {{cannot convert value of type '(Array<Int>, Array<_>)' to specified type '(Array<Int>, Set<String>)'}}
247247
// expected-error@-1 {{could not infer pack element #1 from context}}
248248
}
249249

@@ -274,7 +274,7 @@ func patternInstantiationGenericInvalid<each T: Hashable>(t: repeat each T) {
274274
let _: (repeat Set<each T>) = patternInstantiationTupleTest1() // expected-error {{cannot convert value of type '(repeat Array<each T>)' to specified type '(repeat Set<each T>)}}
275275
// expected-error@-1 {{generic parameter 'each T' could not be inferred}}
276276

277-
let _: (repeat Array<each T>, Set<String>) = patternInstantiationTupleTest1() // expected-error {{'(repeat Array<repeat each T, _>)' is not convertible to '(repeat Array<each T>, Set<String>)', tuples have a different number of elements}}
277+
let _: (repeat Array<each T>, Set<String>) = patternInstantiationTupleTest1() // expected-error {{cannot convert value of type '(repeat Array<each T>, Array<_>)' to specified type '(repeat Array<each T>, Set<String>)'}}
278278
// expected-error@-1 {{could not infer pack element #1 from context}}
279279
}
280280

test/Constraints/tuple_arguments.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1728,7 +1728,7 @@ do {
17281728
do {
17291729
func f(_: Int...) {}
17301730
let _ = [(1, 2, 3)].map(f) // expected-error {{no exact matches in call to instance method 'map'}}
1731-
// expected-note@-1 {{found candidate with type '(((Int, Int, Int)) -> _) -> Array<_>'}}
1731+
// expected-note@-1 2{{found candidate with type '(((Int, Int, Int)) -> T) -> [T]'}}
17321732
}
17331733

17341734
// rdar://problem/48443263 - cannot convert value of type '() -> Void' to expected argument type '(_) -> Void'

test/Generics/issue-55666.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ struct W<T> {}
77
struct S<C1: Collection> {
88
init(){}
99
// expected-note@+2 {{where 'C1.Element' = 'W<C1>', 'main.W<C2.Element>' = 'main.W<C2.Element>'}}
10-
// expected-note@+1 {{where 'C1.Element' = 'W<String>', 'W<C2.Element>' = 'W<Array<Int>.Element>'}}
10+
// expected-note@+1 {{where 'C1.Element' = 'W<String>', 'W<C2.Element>' = 'W<Int>'}}
1111
init<C2>(_ c2: W<C2>) where C2: Collection, C1.Element == W<C2.Element> {}
12-
// expected-note@+1 {{where 'C1.Element' = 'W<String>', 'W<C2.Element>' = 'W<Array<Int>.Element>'}}
12+
// expected-note@+1 {{where 'C1.Element' = 'W<String>', 'W<C2.Element>' = 'W<Int>'}}
1313
static func f<C2>(_ c2: W<C2>) where C2: Collection, C1.Element == W<C2.Element> {}
14-
// expected-note@+1 {{where 'C1.Element' = 'W<String>', 'W<C2.Element>' = 'W<Array<Int>.Element>'}}
14+
// expected-note@+1 {{where 'C1.Element' = 'W<String>', 'W<C2.Element>' = 'W<Int>'}}
1515
func instancef<C2>(_ c2: W<C2>) where C2: Collection, C1.Element == W<C2.Element> {}
1616
}
17-
let _ = S<[W<String>]>(W<[Int]>()) // expected-error{{initializer 'init(_:)' requires the types 'W<String>' and 'W<Array<Int>.Element>' be equivalent}}
18-
let _ = S<[W<String>]>.f(W<[Int]>()) // expected-error{{static method 'f' requires the types 'W<String>' and 'W<Array<Int>.Element>' be equivalent}}
19-
let _ = S<[W<String>]>().instancef(W<[Int]>()) // expected-error{{instance method 'instancef' requires the types 'W<String>' and 'W<Array<Int>.Element>' be equivalent}}
17+
let _ = S<[W<String>]>(W<[Int]>()) // expected-error{{initializer 'init(_:)' requires the types 'W<String>' and 'W<Int>' be equivalent}}
18+
let _ = S<[W<String>]>.f(W<[Int]>()) // expected-error{{static method 'f' requires the types 'W<String>' and 'W<Int>' be equivalent}}
19+
let _ = S<[W<String>]>().instancef(W<[Int]>()) // expected-error{{instance method 'instancef' requires the types 'W<String>' and 'W<Int>' be equivalent}}
2020

2121
// Archetypes requirement failure
2222
func genericFunc<C1: Collection, C2: Collection>(_ c2: W<C2>, c1: C1.Type) where C1.Element == W<C2.Element> {

test/IDE/complete_constructor.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,15 @@ func testDependentTypeInClosure() {
315315
// DEPENDENT_IN_CLOSURE_3-DAG: Decl[Constructor]/CurrNominal/TypeRelation[Convertible]: init({#arg: DataType#}, {#fn: () -> Data.Content##() -> Data.Content#})[#DependentTypeInClosure<DataType>#];
316316

317317
let _ = DependentTypeInClosure(#^DEPENDENT_IN_CLOSURE_1^#)
318-
// DEPENDENT_IN_CLOSURE_1-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#(arg): DataType#}, {#fn: (_) -> Void##(_) -> Void#}[')'][#DependentTypeInClosure<DataType>#];
319-
// DEPENDENT_IN_CLOSURE_1-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#arg: DataType#}, {#fn: () -> _##() -> _#}[')'][#DependentTypeInClosure<DataType>#];
318+
// DEPENDENT_IN_CLOSURE_1-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#(arg): DataType#}, {#fn: (Data.Content) -> Void##(Data.Content) -> Void#}[')'][#DependentTypeInClosure<DataType>#];
319+
// DEPENDENT_IN_CLOSURE_1-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#arg: DataType#}, {#fn: () -> Data.Content##() -> Data.Content#}[')'][#DependentTypeInClosure<DataType>#];
320320

321321
let _ = DependentTypeInClosure.#^DEPENDENT_IN_CLOSURE_2^#
322322
// DEPENDENT_IN_CLOSURE_2: Begin completions, 4 items
323-
// DEPENDENT_IN_CLOSURE_2-DAG: Keyword[self]/CurrNominal: self[#DependentTypeInClosure<_>.Type#]; name=self
324-
// DEPENDENT_IN_CLOSURE_2-DAG: Keyword/CurrNominal: Type[#DependentTypeInClosure<_>.Type#]; name=Type
325-
// DEPENDENT_IN_CLOSURE_2-DAG: Decl[Constructor]/CurrNominal: init({#(arg): _#}, {#fn: (_.Content) -> Void##(_.Content) -> Void#})[#DependentTypeInClosure<_>#]; name=init(:fn:)
326-
// DEPENDENT_IN_CLOSURE_2-DAG: Decl[Constructor]/CurrNominal: init({#arg: _#}, {#fn: () -> _.Content##() -> _.Content#})[#DependentTypeInClosure<_>#]; name=init(arg:fn:)
323+
// DEPENDENT_IN_CLOSURE_2-DAG: Keyword[self]/CurrNominal: self[#DependentTypeInClosure<Data>.Type#]; name=self
324+
// DEPENDENT_IN_CLOSURE_2-DAG: Keyword/CurrNominal: Type[#DependentTypeInClosure<Data>.Type#]; name=Type
325+
// DEPENDENT_IN_CLOSURE_2-DAG: Decl[Constructor]/CurrNominal: init({#(arg): Data#}, {#fn: (Data.Content) -> Void##(Data.Content) -> Void#})[#DependentTypeInClosure<Data>#]; name=init(:fn:)
326+
// DEPENDENT_IN_CLOSURE_2-DAG: Decl[Constructor]/CurrNominal: init({#arg: Data#}, {#fn: () -> Data.Content##() -> Data.Content#})[#DependentTypeInClosure<Data>#]; name=init(arg:fn:)
327327
}
328328
struct InitWithUnresolved<Data: DataType> where Data.Content: Comparable {
329329
init(arg: Data, fn: (Data.Content) -> Void) {}
@@ -334,7 +334,7 @@ extension InitWithUnresolved where Self.Data: Comparable {
334334
func testInitWithUnresolved() {
335335
let _ = InitWithUnresolved(#^INIT_WITH_UNRESOLVEDTYPE_1^#
336336
// INIT_WITH_UNRESOLVEDTYPE_1: Begin completions, 2 items
337-
// INIT_WITH_UNRESOLVEDTYPE_1-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#arg: DataType#}, {#fn: (_) -> Void##(_) -> Void#}[')'][#InitWithUnresolved<DataType>#];
337+
// INIT_WITH_UNRESOLVEDTYPE_1-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#arg: DataType#}, {#fn: (Data.Content) -> Void##(Data.Content) -> Void#}[')'][#InitWithUnresolved<DataType>#];
338338
// INIT_WITH_UNRESOLVEDTYPE_1-DAG: Decl[Constructor]/CurrNominal/Flair[ArgLabels]: ['(']{#arg2: DataType#}[')'][#InitWithUnresolved<DataType>#];
339339
}
340340

test/IDE/complete_crashes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,6 @@ extension P_80635105 {
381381
func test_80635105() {
382382
let fn = { x in
383383
S_80635105.#^RDAR_80635105^#
384-
// RDAR_80635105: Decl[InstanceMethod]/Super: foo({#(self): S_80635105<_>#})[#(P_80635105.T) -> Void#]; name=foo
384+
// RDAR_80635105: Decl[InstanceMethod]/Super: foo({#(self): S_80635105<T>#})[#(P_80635105.T) -> Void#]; name=foo
385385
}
386386
}

test/IDE/complete_enum_elements.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,14 @@ enum BazEnum<T> {
153153
// BAZ_INT_ENUM_NO_DOT-DAG: Keyword[self]/CurrNominal: .self[#BazEnum<Int>.Type#]; name=self
154154
// BAZ_INT_ENUM_NO_DOT-DAG: Keyword/CurrNominal: .Type[#BazEnum<Int>.Type#]; name=Type
155155

156-
// BAZ_T_ENUM_NO_DOT-DAG: Decl[EnumElement]/CurrNominal: .Baz1[#BazEnum<_>#]{{; name=.+$}}
157-
// BAZ_T_ENUM_NO_DOT-DAG: Decl[EnumElement]/CurrNominal: .Baz2({#_#})[#BazEnum<_>#]{{; name=.+$}}
158-
// BAZ_T_ENUM_NO_DOT-DAG: Decl[InstanceMethod]/CurrNominal: .bazInstanceFunc({#(self): &BazEnum<_>#})[#() -> Void#]{{; name=.+$}}
156+
// BAZ_T_ENUM_NO_DOT-DAG: Decl[EnumElement]/CurrNominal: .Baz1[#BazEnum<T>#]{{; name=.+$}}
157+
// BAZ_T_ENUM_NO_DOT-DAG: Decl[EnumElement]/CurrNominal: .Baz2({#T#})[#BazEnum<T>#]{{; name=.+$}}
158+
// BAZ_T_ENUM_NO_DOT-DAG: Decl[InstanceMethod]/CurrNominal: .bazInstanceFunc({#(self): &BazEnum<T>#})[#() -> Void#]{{; name=.+$}}
159159
// BAZ_T_ENUM_NO_DOT-DAG: Decl[StaticVar]/CurrNominal: .staticVar[#Int#]{{; name=.+$}}
160-
// BAZ_T_ENUM_NO_DOT-DAG: Decl[StaticVar]/CurrNominal: .staticVarT[#_#]{{; name=.+$}}
160+
// BAZ_T_ENUM_NO_DOT-DAG: Decl[StaticVar]/CurrNominal: .staticVarT[#T#]{{; name=.+$}}
161161
// BAZ_T_ENUM_NO_DOT-DAG: Decl[StaticMethod]/CurrNominal/TypeRelation[Invalid]: .bazStaticFunc()[#Void#]{{; name=.+$}}
162-
// BAZ_T_ENUM_NO_DOT-DAG: Keyword[self]/CurrNominal: .self[#BazEnum<_>.Type#]; name=self
163-
// BAZ_T_ENUM_NO_DOT-DAG: Keyword/CurrNominal: .Type[#BazEnum<_>.Type#]; name=Type
162+
// BAZ_T_ENUM_NO_DOT-DAG: Keyword[self]/CurrNominal: .self[#BazEnum<T>.Type#]; name=self
163+
// BAZ_T_ENUM_NO_DOT-DAG: Keyword/CurrNominal: .Type[#BazEnum<T>.Type#]; name=Type
164164

165165
// BAZ_INT_ENUM_DOT: Begin completions, 8 items
166166
// BAZ_INT_ENUM_DOT-DAG: Keyword[self]/CurrNominal: self[#BazEnum<Int>.Type#]; name=self
@@ -173,13 +173,13 @@ enum BazEnum<T> {
173173
// BAZ_INT_ENUM_DOT-DAG: Decl[StaticMethod]/CurrNominal/TypeRelation[Invalid]: bazStaticFunc()[#Void#]{{; name=.+$}}
174174

175175
// BAZ_T_ENUM_DOT: Begin completions, 8 items
176-
// BAZ_T_ENUM_DOT-DAG: Keyword[self]/CurrNominal: self[#BazEnum<_>.Type#]; name=self
177-
// BAZ_T_ENUM_DOT-DAG: Keyword/CurrNominal: Type[#BazEnum<_>.Type#]; name=Type
178-
// BAZ_T_ENUM_DOT-DAG: Decl[EnumElement]/CurrNominal: Baz1[#BazEnum<_>#]{{; name=.+$}}
179-
// BAZ_T_ENUM_DOT-DAG: Decl[EnumElement]/CurrNominal: Baz2({#_#})[#BazEnum<_>#]{{; name=.+$}}
180-
// BAZ_T_ENUM_DOT-DAG: Decl[InstanceMethod]/CurrNominal: bazInstanceFunc({#(self): &BazEnum<_>#})[#() -> Void#]{{; name=.+$}}
176+
// BAZ_T_ENUM_DOT-DAG: Keyword[self]/CurrNominal: self[#BazEnum<T>.Type#]; name=self
177+
// BAZ_T_ENUM_DOT-DAG: Keyword/CurrNominal: Type[#BazEnum<T>.Type#]; name=Type
178+
// BAZ_T_ENUM_DOT-DAG: Decl[EnumElement]/CurrNominal: Baz1[#BazEnum<T>#]{{; name=.+$}}
179+
// BAZ_T_ENUM_DOT-DAG: Decl[EnumElement]/CurrNominal: Baz2({#T#})[#BazEnum<T>#]{{; name=.+$}}
180+
// BAZ_T_ENUM_DOT-DAG: Decl[InstanceMethod]/CurrNominal: bazInstanceFunc({#(self): &BazEnum<T>#})[#() -> Void#]{{; name=.+$}}
181181
// BAZ_T_ENUM_DOT-DAG: Decl[StaticVar]/CurrNominal: staticVar[#Int#]{{; name=.+$}}
182-
// BAZ_T_ENUM_DOT-DAG: Decl[StaticVar]/CurrNominal: staticVarT[#_#]{{; name=.+$}}
182+
// BAZ_T_ENUM_DOT-DAG: Decl[StaticVar]/CurrNominal: staticVarT[#T#]{{; name=.+$}}
183183
// BAZ_T_ENUM_DOT-DAG: Decl[StaticMethod]/CurrNominal/TypeRelation[Invalid]: bazStaticFunc()[#Void#]{{; name=.+$}}
184184

185185
enum QuxEnum : Int {

0 commit comments

Comments
 (0)