Files
swift-mirror/test/decl/ext/forward_references.swift
Joe Pamer 31bab38eb4 When attempting to obtain the context type of a type extension, we were never taking into account the fact that the extended type could be potentially be unbound.
(This could occur, for instance, via a forward reference to a member defined in an extension to a generic type.)  This problem has been popping up a lot lately, and
was making some of the recent runtime work difficult.  (rdar://problem/16481483)

Swift SVN r15805
2014-04-02 16:48:14 +00:00

23 lines
500 B
Swift

// RUN: %swift -primary-file %s %S/../../Inputs/forward_extension_reference.swift -target x86_64-apple-darwin10 -emit-ir -g -module-name fref
// RUN: %swift %S/../../Inputs/forward_extension_reference.swift -primary-file %s -target x86_64-apple-darwin10 -emit-ir -g -module-name fref
struct Foo<T> {
func foo(t: T) -> T {
return t
}
var _countAndFlags: UInt = 0
func gar() -> Int {
return count
}
}
func goo<T>(f: Foo<T>) {
var x = f.count
}
protocol Bar {
var count: Int {get set}
}