Skip to content

Commit 01e0b3f

Browse files
committed
Add assertion to make sure selection makes sense
1 parent d8fb65a commit 01e0b3f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,7 @@ object Semantic {
559559
if obj.hasField(target) then
560560
Result(obj.field(target), Nil)
561561
else if ref.isInstanceOf[Warm] then
562+
assert(obj.klass.isSubClass(target.owner))
562563
if target.is(Flags.ParamAccessor) then
563564
// possible for trait parameters
564565
// see tests/init/neg/trait2.scala

0 commit comments

Comments
 (0)