Skip to content

Commit 17b82bd

Browse files
committed
Fix Literalize: (Long(2):Any) == (Int(2): Any) but constants aren't.
1 parent 02e2ca2 commit 17b82bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class Literalize extends MiniPhaseTransform { thisTransform =>
6969
literalize(tree)
7070

7171
override def transformLiteral(tree: Literal)(implicit ctx: Context, info: TransformerInfo): Tree = tree.tpe match {
72-
case ConstantType(const) if tree.const.value != const.value => Literal(const)
72+
case ConstantType(const) if tree.const.value != const.value || (tree.const.tag != const.tag) => Literal(const)
7373
case _ => tree
7474
}
7575

0 commit comments

Comments
 (0)