File tree Expand file tree Collapse file tree 4 files changed +66
-61
lines changed
src/test/scala/scala/async Expand file tree Collapse file tree 4 files changed +66
-61
lines changed Original file line number Diff line number Diff line change @@ -70,15 +70,16 @@ object TreeInterrogation extends App {
70
70
val cm = reflect.runtime.currentMirror
71
71
val tb = mkToolbox(" -cp target/scala-2.10/classes -Xprint:flatten" )
72
72
val tree = tb.parse(
73
- """ import scala.async.AsyncId.{async, await}
74
- | async {
75
- | await(1)
76
- | val neg1 = -1
77
- | val a = await(1)
78
- | val f = { case x => ({case x => neg1 * x}: PartialFunction[Int, Int])(x + a) }: PartialFunction[Int, Int]
79
- | await(f(2))
73
+ """ async {
74
+ | val x = 1
75
+ | val opt = Some("")
76
+ | await(0)
77
+ | val o @ Some(y) = opt
78
+ |
79
+ | {
80
+ | val o @ Some(y) = Some(".")
81
+ | }
80
82
| }
81
- | ()
82
83
| """ .stripMargin)
83
84
println(tree)
84
85
val tree1 = tb.typeCheck(tree.duplicate)
Original file line number Diff line number Diff line change @@ -112,23 +112,24 @@ class AnfTransformSpec {
112
112
State .result mustBe (14 )
113
113
}
114
114
115
- @ Test
116
- def `inlining block does not produce duplicate definition` () {
117
- import scala .async .AsyncId
118
-
119
- AsyncId .async {
120
- val f = 12
121
- val x = AsyncId .await(f)
122
-
123
- {
124
- type X = Int
125
- val x : X = 42
126
- println(x)
127
- }
128
- type X = Int
129
- x : X
130
- }
131
- }
115
+ // TODO 2.10.1
116
+ // @Test
117
+ // def `inlining block does not produce duplicate definition`() {
118
+ // import scala.async.AsyncId
119
+ //
120
+ // AsyncId.async {
121
+ // val f = 12
122
+ // val x = AsyncId.await(f)
123
+ //
124
+ // {
125
+ // type X = Int
126
+ // val x: X = 42
127
+ // println(x)
128
+ // }
129
+ // type X = Int
130
+ // x: X
131
+ // }
132
+ // }
132
133
133
134
@ Test
134
135
def `inlining block in tail position does not produce duplicate definition` () {
Original file line number Diff line number Diff line change @@ -83,23 +83,24 @@ class MatchSpec {
83
83
result mustBe (2 )
84
84
}
85
85
86
- @ Test def `support await referring to pattern matching vals` () {
87
- import AsyncId .{async , await }
88
- val result = async {
89
- val x = 1
90
- val opt = Some (" " )
91
- await(0 )
92
- val o @ Some (y) = opt
93
-
94
- {
95
- val o @ Some (y) = Some (" ." )
96
- }
97
-
98
- await(0 )
99
- await((o, y.isEmpty))
100
- }
101
- result mustBe ((Some (" " ), true ))
102
- }
86
+ // TODO 2.10.1
87
+ // @Test def `support await referring to pattern matching vals`() {
88
+ // import AsyncId.{async, await}
89
+ // val result = async {
90
+ // val x = 1
91
+ // val opt = Some("")
92
+ // await(0)
93
+ // val o @ Some(y) = opt
94
+ //
95
+ // {
96
+ // val o @ Some(y) = Some(".")
97
+ // }
98
+ //
99
+ // await(0)
100
+ // await((o, y.isEmpty))
101
+ // }
102
+ // result mustBe ((Some(""), true))
103
+ // }
103
104
104
105
@ Test def `await in scrutinee` () {
105
106
import AsyncId .{async , await }
Original file line number Diff line number Diff line change @@ -37,26 +37,28 @@ class ToughTypeSpec {
37
37
res._1 mustBe (Nil )
38
38
}
39
39
40
- @ Test def patternMatchingPartialFunction () {
41
- import AsyncId .{await , async }
42
- async {
43
- await(1 )
44
- val a = await(1 )
45
- val f = { case x => x + a }: PartialFunction [Int , Int ]
46
- await(f(2 ))
47
- } mustBe 3
48
- }
40
+ // TODO 2.10.1
41
+ // @Test def patternMatchingPartialFunction() {
42
+ // import AsyncId.{await, async}
43
+ // async {
44
+ // await(1)
45
+ // val a = await(1)
46
+ // val f = { case x => x + a }: PartialFunction[Int, Int]
47
+ // await(f(2))
48
+ // } mustBe 3
49
+ // }
49
50
50
- @ Test def patternMatchingPartialFunctionNested () {
51
- import AsyncId .{await , async }
52
- async {
53
- await(1 )
54
- val neg1 = - 1
55
- val a = await(1 )
56
- val f = { case x => ({case x => neg1 * x}: PartialFunction [Int , Int ])(x + a) }: PartialFunction [Int , Int ]
57
- await(f(2 ))
58
- } mustBe - 3
59
- }
51
+ // TODO 2.10.1
52
+ // @Test def patternMatchingPartialFunctionNested() {
53
+ // import AsyncId.{await, async}
54
+ // async {
55
+ // await(1)
56
+ // val neg1 = -1
57
+ // val a = await(1)
58
+ // val f = { case x => ({case x => neg1 * x}: PartialFunction[Int, Int])(x + a) }: PartialFunction[Int, Int]
59
+ // await(f(2))
60
+ // } mustBe -3
61
+ // }
60
62
61
63
@ Test def patternMatchingFunction () {
62
64
import AsyncId .{await , async }
You can’t perform that action at this time.
0 commit comments