File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -73,14 +73,15 @@ class Literalize extends MiniPhaseTransform { thisTransform =>
73
73
case _ => tree
74
74
}
75
75
76
- /** Check that all literals have types matchin underlying constants
76
+ /** Check that all literals have types match underlying constants
77
77
*/
78
78
override def checkPostCondition (tree : Tree )(implicit ctx : Context ): Unit = {
79
79
tree match {
80
80
case Literal (c @ Constant (treeValue)) =>
81
81
tree.tpe match {
82
- case ConstantType (typeValue) =>
83
- assert(treeValue == typeValue.value, i " Type of Literal $tree is inconsistent with underlying constant " )
82
+ case ConstantType (c2 @ Constant (typeValue)) =>
83
+ assert(treeValue == typeValue && c2.tag == c.tag,
84
+ i " Type of Literal $tree is inconsistent with underlying constant " )
84
85
case tpe =>
85
86
c.tpe =:= tpe
86
87
}
You can’t perform that action at this time.
0 commit comments