File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -3425,7 +3425,7 @@ class Typer extends Namer
34253425 // try converting a constant to the target type
34263426 val folded = ConstFold (tree, pt)
34273427 if (folded ne tree)
3428- return adaptConstant(folded , folded.tpe.asInstanceOf [ConstantType ])
3428+ return adaptConstant(tree , folded.tpe.asInstanceOf [ConstantType ])
34293429
34303430 val captured = captureWildcards(wtp)
34313431 if (captured `ne` wtp)
Original file line number Diff line number Diff line change 1+ object OverloadedWithLong {
2+ def overloaded (x : Long ): Any =
3+ x
4+
5+ def overloaded (x : Any ): Unit =
6+ ???
7+ }
8+
9+ object Test {
10+ def main (args : Array [String ]): Unit =
11+ import OverloadedWithLong ._
12+
13+ val l : Any = 0 :: Nil
14+ val r = overloaded(l match {
15+ case x :: xs => 5
16+ })
17+ assert(r == 5L )
18+ }
You can’t perform that action at this time.
0 commit comments