Files
swift-mirror/test/Constraints/incomplete_function_ref.swift
Chris Lattner f102876943 Improve diagnostics for unbound archetypes coming from a type, to indicate
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> {
       ^
2016-01-21 17:37:39 -08:00

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}}