mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
generic parameters from parent decl contexts. Fixes <rdar://problem/15599314> Crash in the Mangler. Swift SVN r10929
23 lines
532 B
Swift
23 lines
532 B
Swift
// RUN: %swift -enable-dynamic-value-type-layout -triple x86_64-apple-darwin13 %s -emit-llvm -g -o - | FileCheck %s
|
|
class Class <T> {
|
|
var x : T
|
|
|
|
init(_x : T) {x = _x}
|
|
|
|
// Verify that the mangling of the decl context of the type U is correct.
|
|
// CHECK: [ DW_TAG_structure_type ] [_TtQq_FC14dynamic_layout5Class3fooU__FGS0_Q__U__FT1yQ__TQd__Q__]
|
|
func foo <U> (y : U) -> (T,U) {
|
|
var tuple = (x,y)
|
|
return tuple
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
var v = Class<Int>(1)
|
|
var tuple = v.foo("hi")
|
|
println(tuple.0)
|
|
println(tuple.1)
|
|
}
|
|
|
|
main()
|