File tree 4 files changed +15
-11
lines changed
compiler/src/dotty/tools/dotc 4 files changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,7 @@ class TreeMapWithImplicits extends tpd.TreeMapWithPreciseStatContexts {
48
48
override def transform (tree : Tree )(using Context ): Tree = {
49
49
try tree match {
50
50
case Block (stats, expr) =>
51
- inContext(nestedScopeCtx(stats)) {
52
- if stats.exists(_.isInstanceOf [Import ]) then
53
- // need to transform stats and expr together to account for import visibility
54
- val stats1 = transformStats(stats :+ expr, ctx.owner)
55
- cpy.Block (tree)(stats1.init, stats1.last)
56
- else super .transform(tree)
57
- }
51
+ super .transform(tree)(using nestedScopeCtx(stats))
58
52
case tree : DefDef =>
59
53
inContext(localCtx(tree)) {
60
54
cpy.DefDef (tree)(
Original file line number Diff line number Diff line change @@ -1400,7 +1400,8 @@ object Trees {
1400
1400
case Assign (lhs, rhs) =>
1401
1401
cpy.Assign (tree)(transform(lhs), transform(rhs))
1402
1402
case Block (stats, expr) =>
1403
- cpy.Block (tree)(transformStats(stats, ctx.owner), transform(expr))
1403
+ val stats1 = transformStats(stats :+ expr, ctx.owner)
1404
+ cpy.Block (tree)(stats1.init, stats1.last)
1404
1405
case If (cond, thenp, elsep) =>
1405
1406
cpy.If (tree)(transform(cond), transform(thenp), transform(elsep))
1406
1407
case Closure (env, meth, tpt) =>
Original file line number Diff line number Diff line change @@ -296,9 +296,8 @@ class MegaPhase(val miniPhases: Array[MiniPhase]) extends Phase {
296
296
}
297
297
case tree : Block =>
298
298
inContext(prepBlock(tree, start)(using outerCtx)) {
299
- val stats = transformStats(tree.stats, ctx.owner, start)
300
- val expr = transformTree(tree.expr, start)
301
- goBlock(cpy.Block (tree)(stats, expr), start)
299
+ val stats1 = transformStats(tree.stats :+ tree.expr, ctx.owner, start)
300
+ goBlock(cpy.Block (tree)(stats1.init, stats1.last), start)
302
301
}
303
302
case tree : TypeApply =>
304
303
inContext(prepTypeApply(tree, start)(using outerCtx)) {
Original file line number Diff line number Diff line change
1
+ import java .nio .file .FileSystems
2
+ import java .util .ArrayList
3
+
4
+ def directorySeparator : String =
5
+ import scala .language .unsafeNulls
6
+ FileSystems .getDefault().getSeparator()
7
+
8
+ def getFirstOfFirst (xs : ArrayList [ArrayList [ArrayList [String ]]]): String =
9
+ import scala .language .unsafeNulls
10
+ xs.get(0 ).get(0 ).get(0 )
You can’t perform that action at this time.
0 commit comments