forked from swiftlang/swift
- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDynamicSelf.swift
24 lines (21 loc) · 743 Bytes
/
DynamicSelf.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// RUN: %target-swift-frontend %s -emit-ir -g -o - | %FileCheck %s
classC{
letn:Int64
requiredinit(number i :Int64){
self.n = i
}
}
extensionC{
classfunc Factory()->Self{
// Currently we emit the static type C for r.
// CHECK: ![[BASE:.*]] = !DICompositeType({{.*}}identifier: "$s11DynamicSelf1CCD"
// CHECK: !DILocalVariable(name: "r",
// CHECK-SAME: line: [[@LINE+4]], type: ![[SELFTY:[0-9]+]])
// CHECK: ![[SELFTY]] = !DIDerivedType(tag: DW_TAG_typedef,
// CHECK-SAME: name: "$s11DynamicSelf1CCXDD",
// CHECK-SAME: baseType: ![[BASE]])
varr=self.init(number:0)
return r
}
}
letMoreDesignPatterns=C.Factory