Skip to content

Commit 6ce7211

Browse files
committed
Fix type-shifting problem in vcInlineMethods
vcInlineMethods could produce a different type on rewire which led to a -Ycheck failure. We now insert a cast when that happens. Test case: pos/flowops1.scala with -Ycheck:vcInline.
1 parent 40fc718 commit 6ce7211

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/tools/dotc/transform/VCInlineMethods.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class VCInlineMethods extends MiniPhaseTransform with IdentityDenotTransformer {
9090
tree // The rewiring will be handled by a fully-applied parent node
9191
case _ =>
9292
if (isMethodWithExtension(tree.symbol))
93-
rewire(tree)
93+
rewire(tree).ensureConforms(tree.tpe)
9494
else
9595
tree
9696
}

0 commit comments

Comments
 (0)