File tree Expand file tree Collapse file tree 3 files changed +21
-11
lines changed
src/dotty/tools/dotc/core Expand file tree Collapse file tree 3 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -347,19 +347,21 @@ class Definitions {
347
347
348
348
@ tu lazy val ScalaPredefModule : Symbol = {
349
349
val mod = ctx.requiredModule(" scala.Predef" )
350
- mod.infoOrCompleter match {
351
- case completer : ModuleCompleter =>
352
- mod.info = new ModuleCompleter (completer.moduleClass) {
353
- override def complete (root : SymDenotation )(implicit ctx : Context ): Unit = {
354
- super .complete(root)
355
- // Disable the implicit conversion any2stringadd we remove the `implicit` moifier.
356
- // Using it explicitly will emit the usual deprection warining.
357
- val meth = root.requiredMethod(" any2stringadd" )
358
- meth.resetFlag(Implicit )
350
+ if (! ctx.settings.migration.value) {
351
+ mod.infoOrCompleter match {
352
+ case completer : ModuleCompleter =>
353
+ mod.info = new ModuleCompleter (completer.moduleClass) {
354
+ override def complete (root : SymDenotation )(implicit ctx : Context ): Unit = {
355
+ super .complete(root)
356
+ // Disable the implicit conversion any2stringadd we remove the `implicit` moifier.
357
+ // Using it explicitly will emit the usual deprection warining.
358
+ val meth = root.requiredMethod(" any2stringadd" )
359
+ meth.resetFlag(Implicit )
360
+ }
359
361
}
360
- }
361
- case _ =>
362
+ case _ =>
362
363
// Compiling Predef from source
364
+ }
363
365
}
364
366
mod
365
367
}
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class CompilationTests extends ParallelTesting {
47
47
compileFilesInDir(" tests/pos-special/spec-t5545" , defaultOptions),
48
48
compileFilesInDir(" tests/pos-special/strawman-collections" , defaultOptions),
49
49
compileFilesInDir(" tests/pos-special/isInstanceOf" , allowDeepSubtypes.and(" -Xfatal-warnings" )),
50
+ compileFile(" tests/pos-special/i7137.scala" , defaultOptions.and(" -migration" )),
50
51
compileFilesInDir(" tests/new" , defaultOptions),
51
52
compileFilesInDir(" tests/pos-scala2" , scala2Mode),
52
53
compileFilesInDir(" tests/pos" , defaultOptions),
Original file line number Diff line number Diff line change
1
+
2
+ object App {
3
+ val any : Any = 3
4
+ val str : String = any + " a" // allowed with -migration
5
+ val str2 : String = any2stringadd(any) + " a"
6
+ val str3 : String = Predef .any2stringadd(any) + " a"
7
+ }
You can’t perform that action at this time.
0 commit comments