Skip to content

Commit dc7778c

Browse files
committed
Fix #15465: Add test
1 parent 9d07d52 commit dc7778c

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

compiler/src/dotty/tools/dotc/transform/init/Semantic.scala

+1-2
Original file line numberDiff line numberDiff line change
@@ -1515,8 +1515,7 @@ object Semantic:
15151515
resolveThis(target, thisV, cur)
15161516

15171517
case None =>
1518-
// TODO: use error once we fix https://github.com/lampepfl/dotty/issues/15465
1519-
report.warning("[Internal error] unexpected outerSelect, thisV = " + thisV + ", target = " + target.show + ", hops = " + hops, trace.toVector.last.srcPos)
1518+
report.error("[Internal error] unexpected outerSelect, thisV = " + thisV + ", target = " + target.show + ", hops = " + hops, trace.toVector.last.srcPos)
15201519
Cold
15211520

15221521
case RefSet(refs) =>

tests/init/pos/i15465.scala

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class TestSuite:
2+
protected val it = new ItWord
3+
4+
protected final class ItWord:
5+
def should(string: String) = new ItVerbString("should", string)
6+
7+
private def registerTestToRun(fun: => Any): Unit = ()
8+
9+
protected final class ItVerbString(verb: String, name: String):
10+
inline def in(testFun: => Any): Unit = registerTestToRun(testFun)
11+
12+
class MyTest extends TestSuite:
13+
it should "not cause outer select errors" in {
14+
assert(1 + 1 == 2)
15+
}
16+
17+
val n = 10

0 commit comments

Comments
 (0)