mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
information about where the archetype was defined. Before:
t.swift:6:17: error: generic parameter 'T' could not be inferred
var a : Int = A.foo()
^
After:
t.swift:6:17: error: generic parameter 'T' could not be inferred
var a : Int = A.foo()
^
t.swift:2:8: note: 'T' declared as parameter to type 'A'
struct A<T> {
^
14 lines
430 B
Swift
14 lines
430 B
Swift
// RUN: %target-parse-verify-swift
|
|
|
|
struct MyCollection<Element> { // expected-note {{'Element' declared as parameter to type 'MyCollection'}}
|
|
func map<T>(transform: (Element) -> T) -> MyCollection<T> {
|
|
fatalError("implement")
|
|
}
|
|
}
|
|
|
|
MyCollection.map // expected-error{{generic parameter 'Element' could not be inferred}}
|
|
|
|
let a = MyCollection<Int>()
|
|
a.map // expected-error{{generic parameter 'T' could not be inferred}}
|
|
|