[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.
This commit is contained in:
Hamish Knight
2025-10-04 12:56:52 +01:00
parent 7e5dfc28fa
commit 669a2ce9b0
20 changed files with 136 additions and 94 deletions

View File

@@ -56,7 +56,7 @@ class A {
var a: MyArray<Int>
init() {
a = MyArray<Int // expected-error {{generic parameter 'Element' could not be inferred}} expected-note {{explicitly specify the generic arguments to fix this issue}}
// expected-error@-1 {{binary operator '<' cannot be applied to operands of type 'MyArray<_>.Type' and 'Int.Type'}}
// expected-error@-1 {{binary operator '<' cannot be applied to operands of type 'MyArray<Element>.Type' and 'Int.Type'}}
// expected-error@-2 {{cannot assign value of type 'Bool' to type 'MyArray<Int>'}}
}
}