Skip to content

Commit 792b9f7

Browse files
committed
Test for feature shadowing
1 parent 1a947f9 commit 792b9f7

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ class CompilationTests {
167167
compileFile("tests/neg-custom-args/i5498-postfixOps.scala", defaultOptions withoutLanguageFeature "postfixOps"),
168168
compileFile("tests/neg-custom-args/deptypes.scala", defaultOptions.and("-language:experimental.dependent")),
169169
compileFile("tests/neg-custom-args/matchable.scala", defaultOptions.and("-Xfatal-warnings", "-source", "future")),
170-
compileFile("tests/neg-custom-args/i7314.scala", defaultOptions.and("-Xfatal-warnings", "-source", "future"))
170+
compileFile("tests/neg-custom-args/i7314.scala", defaultOptions.and("-Xfatal-warnings", "-source", "future")),
171+
compileFile("tests/neg-custom-args/feature-shadowing.scala", defaultOptions.and("-Xfatal-warnings", "-feature")),
171172
).checkExpectedErrors()
172173
}
173174

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import language.implicitConversions
2+
given Conversion[Int, String] = _.toString
3+
4+
object a:
5+
val s: String = 1 // OK
6+
7+
object b:
8+
import language.implicitConversions as _
9+
val s: String = 2 // error
10+
11+
object c:
12+
import language.implicitConversions
13+
val s: String = 3 // OK again

0 commit comments

Comments
 (0)