mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
There's no need to instantiate archetypes in the generic environment of the declaration being opened. A couple of diagnostics changed. They were already misleading, and the new diagnostics, while different, are not any more misleading than before.
17 lines
432 B
Swift
17 lines
432 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
struct Foo<T, U> { // expected-note {{'U' declared as parameter to type 'Foo'}}
|
|
var value: U
|
|
func bar() -> Foo<T, U> {
|
|
return Foo(value)
|
|
// expected-error@-1 {{generic parameter 'U' could not be inferred}}
|
|
// expected-note@-2 {{explicitly specify the generic arguments to fix this issue}}
|
|
}
|
|
}
|
|
|
|
extension Foo where T == U {
|
|
init(_ value: U) {
|
|
self.value = value
|
|
}
|
|
}
|