@@ -1414,7 +1414,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
1414
1414
js.MethodIdent (name),
1415
1415
NoOriginalName ,
1416
1416
Nil ,
1417
- jstpe.NoType ,
1417
+ jstpe.VoidType ,
1418
1418
Some (stats))(
1419
1419
OptimizerHints .empty, Unversioned )
1420
1420
}
@@ -1842,7 +1842,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
1842
1842
}
1843
1843
}
1844
1844
1845
- js.If (cond, body, js.Skip ())(jstpe.NoType )
1845
+ js.If (cond, body, js.Skip ())(jstpe.VoidType )
1846
1846
}
1847
1847
1848
1848
/* preStats / postStats use pre/post order traversal respectively to
@@ -2080,7 +2080,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
2080
2080
val namespace = js.MemberNamespace .Constructor
2081
2081
js.MethodDef (
2082
2082
js.MemberFlags .empty.withNamespace(namespace), methodName,
2083
- originalName, jsParams, jstpe.NoType , Some (genStat(dd.rhs)))(
2083
+ originalName, jsParams, jstpe.VoidType , Some (genStat(dd.rhs)))(
2084
2084
optimizerHints, Unversioned )
2085
2085
} else {
2086
2086
val resultIRType = toIRType(sym.tpe.resultType)
@@ -2180,7 +2180,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
2180
2180
}
2181
2181
}
2182
2182
val newBody = body.map(
2183
- b => transformer.transform(b, isStat = resultType == jstpe.NoType ))
2183
+ b => transformer.transform(b, isStat = resultType == jstpe.VoidType ))
2184
2184
js.MethodDef (flags, methodName, originalName, newParams, resultType,
2185
2185
newBody)(methodDef.optimizerHints, Unversioned )(methodDef.pos)
2186
2186
}
@@ -2216,7 +2216,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
2216
2216
}
2217
2217
}
2218
2218
val newBody = body.map(
2219
- b => transformer.transform(b, isStat = resultType == jstpe.NoType ))
2219
+ b => transformer.transform(b, isStat = resultType == jstpe.VoidType ))
2220
2220
js.MethodDef (flags, methodName, originalName, newParams, resultType,
2221
2221
newBody)(methodDef.optimizerHints, Unversioned )(methodDef.pos)
2222
2222
}
@@ -2248,7 +2248,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
2248
2248
optimizerHints : OptimizerHints ): js.MethodDef = {
2249
2249
implicit val pos = tree.pos
2250
2250
2251
- val bodyIsStat = resultIRType == jstpe.NoType
2251
+ val bodyIsStat = resultIRType == jstpe.VoidType
2252
2252
2253
2253
def genBodyWithinReturnableScope (): js.Tree = tree match {
2254
2254
case Block (
@@ -2439,8 +2439,8 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
2439
2439
*/
2440
2440
def genExpr (tree : Tree ): js.Tree = {
2441
2441
val result = genStatOrExpr(tree, isStat = false )
2442
- assert(result.tpe != jstpe.NoType ,
2443
- s " genExpr( $tree) returned a tree with type NoType at pos ${tree.pos}" )
2442
+ assert(result.tpe != jstpe.VoidType ,
2443
+ s " genExpr( $tree) returned a tree with type VoidType at pos ${tree.pos}" )
2444
2444
result
2445
2445
}
2446
2446
@@ -2517,7 +2517,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
2517
2517
case tree @ If (cond, thenp, elsep) =>
2518
2518
def default : js.Tree = {
2519
2519
val tpe =
2520
- if (isStat) jstpe.NoType
2520
+ if (isStat) jstpe.VoidType
2521
2521
else toIRType(tree.tpe)
2522
2522
2523
2523
js.If (genExpr(cond), genStatOrExpr(thenp, isStat),
@@ -2559,8 +2559,8 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
2559
2559
2560
2560
case Return (expr) =>
2561
2561
js.Return (toIRType(expr.tpe) match {
2562
- case jstpe.NoType => js.Block (genStat(expr), js.Undefined ())
2563
- case _ => genExpr(expr)
2562
+ case jstpe.VoidType => js.Block (genStat(expr), js.Undefined ())
2563
+ case _ => genExpr(expr)
2564
2564
}, getEnclosingReturnLabel())
2565
2565
2566
2566
case t : Try =>
@@ -2916,7 +2916,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
2916
2916
if (transformedRhs.tpe == jstpe.NothingType ) {
2917
2917
// In this case, we do not need the outer block label
2918
2918
js.While (js.BooleanLiteral (true ), {
2919
- js.Labeled (labelIdent, jstpe.NoType , {
2919
+ js.Labeled (labelIdent, jstpe.VoidType , {
2920
2920
transformedRhs match {
2921
2921
// Eliminate a trailing return@lab
2922
2922
case js.Block (stats :+ ReturnFromThisLabel (exprAsStat)) =>
@@ -2930,11 +2930,11 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
2930
2930
// When all else has failed, we need the full machinery
2931
2931
val blockLabelIdent = freshLabelIdent(" block" )
2932
2932
val bodyType =
2933
- if (isStat) jstpe.NoType
2933
+ if (isStat) jstpe.VoidType
2934
2934
else toIRType(tree.tpe)
2935
2935
js.Labeled (blockLabelIdent, bodyType, {
2936
2936
js.While (js.BooleanLiteral (true ), {
2937
- js.Labeled (labelIdent, jstpe.NoType , {
2937
+ js.Labeled (labelIdent, jstpe.VoidType , {
2938
2938
if (isStat)
2939
2939
js.Block (transformedRhs, js.Return (js.Undefined (), blockLabelIdent))
2940
2940
else
@@ -3050,7 +3050,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
3050
3050
val blockAST = genStatOrExpr(block, isStat)
3051
3051
3052
3052
val resultType =
3053
- if (isStat) jstpe.NoType
3053
+ if (isStat) jstpe.VoidType
3054
3054
else toIRType(tree.tpe)
3055
3055
3056
3056
val handled =
@@ -3282,7 +3282,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
3282
3282
val r = toIRType(to)
3283
3283
3284
3284
def isValueType (tpe : jstpe.Type ): Boolean = tpe match {
3285
- case jstpe.NoType | jstpe.BooleanType | jstpe.CharType |
3285
+ case jstpe.VoidType | jstpe.BooleanType | jstpe.CharType |
3286
3286
jstpe.ByteType | jstpe.ShortType | jstpe.IntType | jstpe.LongType |
3287
3287
jstpe.FloatType | jstpe.DoubleType =>
3288
3288
true
@@ -3625,7 +3625,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
3625
3625
.withNoinline(noinline)
3626
3626
val methodIdent = encodeMethodSym(method)
3627
3627
val resultType =
3628
- if (method.isClassConstructor) jstpe.NoType
3628
+ if (method.isClassConstructor) jstpe.VoidType
3629
3629
else toIRType(method.tpe.resultType)
3630
3630
js.ApplyStatically (flags, receiver, encodeClassName(method.owner),
3631
3631
methodIdent, arguments)(resultType)
@@ -3891,7 +3891,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
3891
3891
val genSelector = genExpr(selector)
3892
3892
3893
3893
val resultType =
3894
- if (isStat) jstpe.NoType
3894
+ if (isStat) jstpe.VoidType
3895
3895
else toIRType(tree.tpe)
3896
3896
3897
3897
val defaultLabelSym = cases.collectFirst {
@@ -4035,8 +4035,8 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
4035
4035
(alts, newBody)
4036
4036
}
4037
4037
js.Labeled (matchResultLabel, resultType, js.Block (List (
4038
- js.Labeled (elseClauseLabel, jstpe.NoType , {
4039
- buildMatch(patchedClauses.reverse, js.Skip (), jstpe.NoType )
4038
+ js.Labeled (elseClauseLabel, jstpe.VoidType , {
4039
+ buildMatch(patchedClauses.reverse, js.Skip (), jstpe.VoidType )
4040
4040
}),
4041
4041
elseClause
4042
4042
)))
@@ -4133,7 +4133,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
4133
4133
val translatedMatch = genTranslatedMatch(cases, matchEnd)
4134
4134
val genMore = genBlockWithCaseLabelDefs(more, isStat)
4135
4135
val label = getEnclosingReturnLabel()
4136
- if (translatedMatch.tpe == jstpe.NoType ) {
4136
+ if (translatedMatch.tpe == jstpe.VoidType ) {
4137
4137
// Could not actually reproduce this, but better be safe than sorry
4138
4138
translatedMatch :: js.Return (js.Undefined (), label) :: genMore
4139
4139
} else {
@@ -4217,7 +4217,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
4217
4217
tree match {
4218
4218
case If (cond, thenp, elsep) =>
4219
4219
js.If (genExpr(cond), genCaseBody(thenp), genCaseBody(elsep))(
4220
- jstpe.NoType )
4220
+ jstpe.VoidType )
4221
4221
4222
4222
case Block (stats, Literal (Constant (()))) =>
4223
4223
// Generated a lot by the async transform
@@ -4272,7 +4272,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
4272
4272
4273
4273
def genMatchEndBody (): js.Tree = {
4274
4274
genStatOrExpr(matchEndBody,
4275
- isStat = toIRType(matchEndBody.tpe) == jstpe.NoType )
4275
+ isStat = toIRType(matchEndBody.tpe) == jstpe.VoidType )
4276
4276
}
4277
4277
4278
4278
matchEnd.params match {
@@ -4326,7 +4326,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
4326
4326
) {
4327
4327
genTranslatedCases
4328
4328
}
4329
- val optimized = genOptimizedMatchEndLabeled(labelIdent, jstpe.NoType ,
4329
+ val optimized = genOptimizedMatchEndLabeled(labelIdent, jstpe.VoidType ,
4330
4330
translatedCases, info.generatedReturns)
4331
4331
js.Block (varDefs ::: optimized :: genMatchEndBody() :: Nil )
4332
4332
}
@@ -4379,7 +4379,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
4379
4379
implicit pos : Position ): js.Tree = {
4380
4380
4381
4381
def default : js.Tree =
4382
- js.Labeled (label, jstpe.NoType , translatedBody)
4382
+ js.Labeled (label, jstpe.VoidType , translatedBody)
4383
4383
4384
4384
if (returnCount == 0 ) {
4385
4385
translatedBody
@@ -4403,7 +4403,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
4403
4403
case _ =>
4404
4404
js.UnaryOp (js.UnaryOp .Boolean_! , cond)
4405
4405
}
4406
- js.Block (stats1 :+ js.If (notCond, js.Block (stats2), js.Skip ())(jstpe.NoType ))
4406
+ js.Block (stats1 :+ js.If (notCond, js.Block (stats2), js.Skip ())(jstpe.VoidType ))
4407
4407
4408
4408
case _ :: _ =>
4409
4409
throw new AssertionError (" unreachable code" )
@@ -5219,7 +5219,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
5219
5219
def makePrimitiveBox (expr : js.Tree , tpe : Type )(
5220
5220
implicit pos : Position ): js.Tree = {
5221
5221
toIRType(tpe) match {
5222
- case jstpe.NoType => // for JS interop cases
5222
+ case jstpe.VoidType => // for JS interop cases
5223
5223
js.Block (expr, js.Undefined ())
5224
5224
case jstpe.BooleanType | jstpe.CharType | jstpe.ByteType |
5225
5225
jstpe.ShortType | jstpe.IntType | jstpe.LongType | jstpe.FloatType |
@@ -5234,8 +5234,8 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
5234
5234
def makePrimitiveUnbox (expr : js.Tree , tpe : Type )(
5235
5235
implicit pos : Position ): js.Tree = {
5236
5236
toIRType(tpe) match {
5237
- case jstpe.NoType => expr // for JS interop cases
5238
- case irTpe => js.AsInstanceOf (expr, irTpe)
5237
+ case jstpe.VoidType => expr // for JS interop cases
5238
+ case irTpe => js.AsInstanceOf (expr, irTpe)
5239
5239
}
5240
5240
}
5241
5241
@@ -6135,8 +6135,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
6135
6135
*
6136
6136
* we generate a function:
6137
6137
*
6138
- * lambda<o, c1, ..., cM>[notype](
6139
- * outer, capture1, ..., captureM, param1, ..., paramN) {
6138
+ * arrow-lambda<o = outer, c1 = capture1, ..., cM = captureM>(param1, ..., paramN) {
6140
6139
* <body>
6141
6140
* }
6142
6141
*
@@ -6206,8 +6205,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
6206
6205
*
6207
6206
* we generate a function:
6208
6207
*
6209
- * lambda<o, c1, ..., cM>[notype](
6210
- * outer, capture1, ..., captureM, param1, ..., paramN) {
6208
+ * arrow-lambda<o = outer, c1 = capture1, ..., cM = captureM>(param1, ..., paramN) {
6211
6209
* outer.lambdaImpl(param1, ..., paramN, capture1, ..., captureM)
6212
6210
* }
6213
6211
*/
@@ -6540,7 +6538,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
6540
6538
js.MethodIdent (ObjectArgConstructorName ),
6541
6539
NoOriginalName ,
6542
6540
List (fParamDef),
6543
- jstpe.NoType ,
6541
+ jstpe.VoidType ,
6544
6542
Some (js.Block (List (
6545
6543
js.Assign (
6546
6544
js.Select (js.This ()(thisType), fFieldIdent)(jstpe.AnyType ),
@@ -6549,7 +6547,7 @@ abstract class GenJSCode[G <: Global with Singleton](val global: G)
6549
6547
js.This ()(thisType),
6550
6548
ir.Names .ObjectClass ,
6551
6549
js.MethodIdent (ir.Names .NoArgConstructorName ),
6552
- Nil )(jstpe.NoType )))))(
6550
+ Nil )(jstpe.VoidType )))))(
6553
6551
js.OptimizerHints .empty, Unversioned )
6554
6552
}
6555
6553
0 commit comments