/
t12240.check
237 lines (235 loc) · 8.49 KB
/
t12240.check
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
newSource1.scala:40: warning: unreachable code
case ElidableIsEmpty(x) => x
^
[[syntax trees at end of patmat]] // newSource1.scala
package <empty> {
object SideEffectingIsEmpty extends scala.AnyRef {
def <init>(): SideEffectingIsEmpty.type = {
SideEffectingIsEmpty.super.<init>();
()
};
def unapply(i: Int): SideEffectingIsEmpty.type = this;
def isEmpty: false = {
scala.Predef.println("confirm isEmpty method doesn\'t get elided");
false
};
private[this] val get: Int = 7;
<stable> <accessor> def get: Int = SideEffectingIsEmpty.this.get
};
object ElidableIsEmpty extends scala.AnyRef {
def <init>(): ElidableIsEmpty.type = {
ElidableIsEmpty.super.<init>();
()
};
def unapply(i: Int): ElidableIsEmpty.type = this;
private[this] val isEmpty: false = false;
<stable> <accessor> def isEmpty: false = ElidableIsEmpty.this.isEmpty;
private[this] val get: Int = 8;
<stable> <accessor> def get: Int = ElidableIsEmpty.this.get
};
object SideEffectingIsEmptySeq extends scala.AnyRef {
def <init>(): SideEffectingIsEmptySeq.type = {
SideEffectingIsEmptySeq.super.<init>();
()
};
def unapplySeq(i: Int): SideEffectingIsEmptySeq.type = this;
private[this] val length: Int = 3;
<stable> <accessor> def length: Int = SideEffectingIsEmptySeq.this.length;
private[this] val get: SideEffectingIsEmptySeq.type = this;
<stable> <accessor> def get: SideEffectingIsEmptySeq.type = SideEffectingIsEmptySeq.this.get;
private[this] val toSeq: List[String] = scala.`package`.List.apply[String]("Got", "Some", "List");
<stable> <accessor> def toSeq: List[String] = SideEffectingIsEmptySeq.this.toSeq;
def apply(i: Int): String = SideEffectingIsEmptySeq.this.toSeq.apply(i);
def isEmpty: false = {
scala.Predef.println("confirm seq isEmpty method doesn\'t get elided");
false
}
};
object ElidableIsEmptySeq extends scala.AnyRef {
def <init>(): ElidableIsEmptySeq.type = {
ElidableIsEmptySeq.super.<init>();
()
};
def unapplySeq(i: Int): ElidableIsEmptySeq.type = this;
private[this] val length: Int = 3;
<stable> <accessor> def length: Int = ElidableIsEmptySeq.this.length;
private[this] val get: ElidableIsEmptySeq.type = this;
<stable> <accessor> def get: ElidableIsEmptySeq.type = ElidableIsEmptySeq.this.get;
private[this] val toSeq: List[String] = scala.`package`.List.apply[String]("Got", "Some", "List");
<stable> <accessor> def toSeq: List[String] = ElidableIsEmptySeq.this.toSeq;
def apply(i: Int): String = ElidableIsEmptySeq.this.toSeq.apply(i);
private[this] val isEmpty: false = false;
<stable> <accessor> def isEmpty: false = ElidableIsEmptySeq.this.isEmpty
};
object UseIt extends scala.AnyRef {
def <init>(): UseIt.type = {
UseIt.super.<init>();
()
};
def main(args: Array[String]): Int = {
case <synthetic> val x1: Int = args.length;
case8(){
<synthetic> val o10: SideEffectingIsEmpty.type = SideEffectingIsEmpty.unapply(x1);
if (o10.isEmpty.unary_!)
{
val x: Int = o10.get;
matchEnd7(x)
}
else
case9()
};
case9(){
<synthetic> val o12: ElidableIsEmpty.type = ElidableIsEmpty.unapply(x1);
if (o12.isEmpty.unary_!)
{
val x: Int = o12.get;
matchEnd7(x)
}
else
case11()
};
case11(){
<synthetic> val o14: SideEffectingIsEmptySeq.type = SideEffectingIsEmptySeq.unapplySeq(x1);
if (o14.isEmpty.unary_!)
{
val s: Seq[String] = o14.get.toSeq;
matchEnd7(s.length)
}
else
case13()
};
case13(){
<synthetic> val o16: ElidableIsEmptySeq.type = ElidableIsEmptySeq.unapplySeq(x1);
if (o16.isEmpty.unary_!)
{
val s: Seq[String] = o16.get.toSeq;
matchEnd7(s.length)
}
else
case15()
};
case15(){
matchEnd7(throw new MatchError(x1))
};
matchEnd7(x: Int){
x
}
}
}
}
[[syntax trees at end of posterasure]] // newSource1.scala
package <empty> {
object SideEffectingIsEmpty extends Object {
def <init>(): SideEffectingIsEmpty.type = {
SideEffectingIsEmpty.super.<init>();
()
};
def unapply(i: Int): SideEffectingIsEmpty.type = this;
def isEmpty(): Boolean = {
scala.Predef.println("confirm isEmpty method doesn\'t get elided");
false
};
private[this] val get: Int = 7;
<stable> <accessor> def get(): Int = SideEffectingIsEmpty.this.get
};
object ElidableIsEmpty extends Object {
def <init>(): ElidableIsEmpty.type = {
ElidableIsEmpty.super.<init>();
()
};
def unapply(i: Int): ElidableIsEmpty.type = this;
private[this] val isEmpty: Boolean = false;
<stable> <accessor> def isEmpty(): Boolean = ElidableIsEmpty.this.isEmpty;
private[this] val get: Int = 8;
<stable> <accessor> def get(): Int = ElidableIsEmpty.this.get
};
object SideEffectingIsEmptySeq extends Object {
def <init>(): SideEffectingIsEmptySeq.type = {
SideEffectingIsEmptySeq.super.<init>();
()
};
def unapplySeq(i: Int): SideEffectingIsEmptySeq.type = this;
private[this] val length: Int = 3;
<stable> <accessor> def length(): Int = SideEffectingIsEmptySeq.this.length;
private[this] val get: SideEffectingIsEmptySeq.type = this;
<stable> <accessor> def get(): SideEffectingIsEmptySeq.type = SideEffectingIsEmptySeq.this.get;
private[this] val toSeq: List = scala.`package`.List().apply(scala.runtime.ScalaRunTime.wrapRefArray(Array[String]{"Got", "Some", "List"}.$asInstanceOf[Array[Object]]())).$asInstanceOf[List]();
<stable> <accessor> def toSeq(): List = SideEffectingIsEmptySeq.this.toSeq;
def apply(i: Int): String = SideEffectingIsEmptySeq.this.toSeq().apply(i).$asInstanceOf[String]();
def isEmpty(): Boolean = {
scala.Predef.println("confirm seq isEmpty method doesn\'t get elided");
false
}
};
object ElidableIsEmptySeq extends Object {
def <init>(): ElidableIsEmptySeq.type = {
ElidableIsEmptySeq.super.<init>();
()
};
def unapplySeq(i: Int): ElidableIsEmptySeq.type = this;
private[this] val length: Int = 3;
<stable> <accessor> def length(): Int = ElidableIsEmptySeq.this.length;
private[this] val get: ElidableIsEmptySeq.type = this;
<stable> <accessor> def get(): ElidableIsEmptySeq.type = ElidableIsEmptySeq.this.get;
private[this] val toSeq: List = scala.`package`.List().apply(scala.runtime.ScalaRunTime.wrapRefArray(Array[String]{"Got", "Some", "List"}.$asInstanceOf[Array[Object]]())).$asInstanceOf[List]();
<stable> <accessor> def toSeq(): List = ElidableIsEmptySeq.this.toSeq;
def apply(i: Int): String = ElidableIsEmptySeq.this.toSeq().apply(i).$asInstanceOf[String]();
private[this] val isEmpty: Boolean = false;
<stable> <accessor> def isEmpty(): Boolean = ElidableIsEmptySeq.this.isEmpty
};
object UseIt extends Object {
def <init>(): UseIt.type = {
UseIt.super.<init>();
()
};
def main(args: Array[String]): Int = {
case <synthetic> val x1: Int = args.length();
case8(){
<synthetic> val o10: SideEffectingIsEmpty.type = SideEffectingIsEmpty.unapply(x1);
if (o10.isEmpty().unary_!())
{
val x: Int = o10.get();
matchEnd7(x)
}
else
case9()
};
case9(){
<synthetic> val o12: ElidableIsEmpty.type = ElidableIsEmpty.unapply(x1);
if (o12.isEmpty().unary_!())
{
val x: Int = o12.get();
matchEnd7(x)
}
else
case11()
};
case11(){
<synthetic> val o14: SideEffectingIsEmptySeq.type = SideEffectingIsEmptySeq.unapplySeq(x1);
if (o14.isEmpty().unary_!())
{
val s: Seq = o14.get().toSeq();
matchEnd7(s.length())
}
else
case13()
};
case13(){
<synthetic> val o16: ElidableIsEmptySeq.type = ElidableIsEmptySeq.unapplySeq(x1);
if (o16.isEmpty().unary_!())
{
val s: Seq = o16.get().toSeq();
matchEnd7(s.length())
}
else
case15()
};
case15(){
matchEnd7(throw new MatchError(scala.Int.box(x1)))
};
matchEnd7(x: Int){
x
}
}
}
}