- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathenum.swift
41 lines (30 loc) · 1.01 KB
/
enum.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -module-name def_enum -o %t %S/Inputs/def_enum.swift %S/Inputs/def_enum_derived.swift -enable-library-evolution
// RUN: llvm-bcanalyzer %t/def_enum.swiftmodule | %FileCheck %s
// RUN: %target-swift-frontend -typecheck -I %t %s -o /dev/null
// RUN: %target-swift-frontend -emit-sil -I %t %s -o /dev/null
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -print-module -module-to-print=def_enum -I %t -source-filename=%s | %FileCheck -check-prefix=CHECK-PRINT %s
// CHECK-NOT: UnknownCode
// CHECK-PRINT-DAG: @frozen enum Exhaustive {
import def_enum
extensionBasic{
init(silly:Int){
self.init()
self=.HasType(silly)
}
}
vara:Basic
a =.Untyped
a.doSomething()
a =.HasType(4)
a.doSomething()
varg=Generic.Left(false)
g =.Right(true)
varlazy=Lazy.Thunk({42})
varcomp:Computable= lazy
comp.compute()
lazy.compute()
structTea{}
letmeal= Breakfast<Basic>.Bacon
letn= meal.rawValue
do{throw meal }catch{}