Skip to content

Commit ef71699

Browse files
committed
Default false -Yrepl-{class-based,use-magic-imports}
The intent is for these to be true, but we'll do that for 2.13.x, not 2.12.x.
1 parent ea766bd commit ef71699

File tree

7 files changed

+35
-24
lines changed

7 files changed

+35
-24
lines changed

src/compiler/scala/tools/nsc/settings/ScalaSettings.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ trait ScalaSettings extends AbsScalaSettings
236236
val Ymacronoexpand = BooleanSetting ("-Ymacro-no-expand", "Don't expand macros. Might be useful for scaladoc and presentation compiler, but will crash anything which uses macros and gets past typer.") withDeprecationMessage(s"Use ${Ymacroexpand.name}:${MacroExpand.None}") withPostSetHook(_ => Ymacroexpand.value = MacroExpand.None)
237237
val YmacroFresh = BooleanSetting ("-Ymacro-global-fresh-names", "Should fresh names in macros be unique across all compilation units")
238238
val Yreplsync = BooleanSetting ("-Yrepl-sync", "Do not use asynchronous code for repl startup")
239-
val Yreplclassbased = BooleanSetting ("-Yrepl-class-based", "Use classes to wrap REPL snippets instead of objects") withDefault true
240-
val YreplMagicImport = BooleanSetting ("-Yrepl-use-magic-imports", "In the code that wraps REPL snippets, use magic imports rather than nesting wrapper object/classes") withDefault true
239+
val Yreplclassbased = BooleanSetting ("-Yrepl-class-based", "Use classes to wrap REPL snippets instead of objects")
240+
val YreplMagicImport = BooleanSetting ("-Yrepl-use-magic-imports", "In the code that wraps REPL snippets, use magic imports rather than nesting wrapper object/classes")
241241
val Yreploutdir = StringSetting ("-Yrepl-outdir", "path", "Write repl-generated classfiles to given output directory (use \"\" to generate a temporary dir)" , "")
242242
val YmethodInfer = BooleanSetting ("-Yinfer-argument-types", "Infer types for arguments of overridden methods.")
243243
val YdisableFlatCpCaching = BooleanSetting ("-YdisableFlatCpCaching", "Do not cache flat classpath representation of classpath elements from jars across compiler instances.")

test/files/run/repl-colon-type.check

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ scala> :type lazy val f = 5
3434
Int
3535

3636
scala> :type protected lazy val f = 5
37-
<console>:5: error: lazy value f cannot be accessed in INSTANCE.$iw
37+
<console>:5: error: lazy value f cannot be accessed in object $iw
3838
Access to protected lazy value f not permitted because
3939
enclosing object $eval in package $line13 is not a subclass of
40-
class $iw where target is defined
40+
object $iw where target is defined
4141
lazy val $result = f
42-
^
42+
^
4343

4444
scala> :type def f = 5
4545
=> Int

test/files/run/repl-out-dir.check

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,31 @@ repl-out-dir-run.obj
1313
$line2
1414
$eval$.class
1515
$eval.class
16-
$read$$iw.class
16+
$read$$iw$$iw$.class
17+
$read$$iw$.class
1718
$read$.class
1819
$read.class
1920
$line3
2021
$eval$.class
2122
$eval.class
22-
$read$$iw$Bippy$.class
23-
$read$$iw$Bippy.class
24-
$read$$iw.class
23+
$read$$iw$$iw$.class
24+
$read$$iw$$iw$Bippy$.class
25+
$read$$iw$$iw$Bippy.class
26+
$read$$iw$.class
2527
$read$.class
2628
$read.class
2729
$line4
2830
$eval$.class
2931
$eval.class
30-
$read$$iw.class
32+
$read$$iw$$iw$.class
33+
$read$$iw$.class
3134
$read$.class
3235
$read.class
3336
$line5
3437
$eval$.class
3538
$eval.class
36-
$read$$iw.class
39+
$read$$iw$$iw$.class
40+
$read$$iw$.class
3741
$read$.class
3842
$read.class
3943
$repl_$init.class

test/files/run/repl-trim-stack-trace.check

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ f: Nothing
66

77
scala> f
88
java.lang.Exception: Uh-oh
9-
at f(<console>:11)
9+
at .f(<console>:XX)
1010
... ??? elided
1111

1212
scala> def f = throw new Exception("")
1313
f: Nothing
1414

1515
scala> f
1616
java.lang.Exception:
17-
at f(<console>:11)
17+
at .f(<console>:XX)
1818
... ??? elided
1919

2020
scala> def f = throw new Exception
2121
f: Nothing
2222

2323
scala> f
2424
java.lang.Exception
25-
at f(<console>:11)
25+
at .f(<console>:XX)
2626
... ??? elided
2727

2828
scala> :quit

test/files/run/t5256d.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ scala> println(c)
1515
class A
1616

1717
scala> println(c.fullName)
18-
$line8.$read.$iw.A
18+
$line8.$read.$iw.$iw.$iw.$iw.A
1919

2020
scala> println(c.info)
2121
AnyRef {

test/files/run/t7747-repl.check

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,18 +251,25 @@ sealed class $read extends _root_.java.io.Serializable {
251251
super.<init>;
252252
()
253253
};
254-
import $line44.$read.INSTANCE.$iw.BippyBups;
255-
import $line44.$read.INSTANCE.$iw.BippyBups;
256-
import $line45.$read.INSTANCE.$iw.PuppyPups;
257-
import $line45.$read.INSTANCE.$iw.PuppyPups;
258-
import $line46.$read.INSTANCE.$iw.Bingo;
259-
import $line46.$read.INSTANCE.$iw.Bingo;
260254
sealed class $iw extends _root_.java.io.Serializable {
261255
def <init>() = {
262256
super.<init>;
263257
()
264258
};
265-
val res3 = List(BippyBups, PuppyPups, Bingo)
259+
import $line44.$read.INSTANCE.$iw.$iw.BippyBups;
260+
import $line44.$read.INSTANCE.$iw.$iw.BippyBups;
261+
import $line45.$read.INSTANCE.$iw.$iw.PuppyPups;
262+
import $line45.$read.INSTANCE.$iw.$iw.PuppyPups;
263+
import $line46.$read.INSTANCE.$iw.$iw.Bingo;
264+
import $line46.$read.INSTANCE.$iw.$iw.Bingo;
265+
sealed class $iw extends _root_.java.io.Serializable {
266+
def <init>() = {
267+
super.<init>;
268+
()
269+
};
270+
val res3 = List(BippyBups, PuppyPups, Bingo)
271+
};
272+
val $iw = new $iw.<init>
266273
};
267274
val $iw = new $iw.<init>
268275
}

test/files/run/t8843-repl-xlat.check

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ scala> class Bippy
66
defined class Bippy
77

88
scala> $intp.classLoader getResource "Bippy.class"
9-
res0: java.net.URL = memory:(memory)/$line4/$read$$iw$Bippy.class
9+
res0: java.net.URL = memory:(memory)/$line4/$read$$iw$$iw$Bippy.class
1010

1111
scala> ($intp.classLoader getResources "Bippy.class").nextElement
12-
res1: java.net.URL = memory:(memory)/$line4/$read$$iw$Bippy.class
12+
res1: java.net.URL = memory:(memory)/$line4/$read$$iw$$iw$Bippy.class
1313

1414
scala> ($intp.classLoader classBytes "Bippy").nonEmpty
1515
res2: Boolean = true

0 commit comments

Comments
 (0)