Skip to content

Commit b523a05

Browse files
committed
Simplify handling of pimitive types
1 parent 8374c4d commit b523a05

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

compiler/src/dotty/tools/dotc/transform/ReifyQuotes.scala

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,15 +209,7 @@ class ReifyQuotes extends MacroTransform {
209209
if (splices.nonEmpty) pickleAsTasty()
210210
else if (isType) {
211211
def tag(tagName: String) = ref(defn.QuotedTypeModule).select(tagName.toTermName)
212-
if (body.symbol == defn.UnitClass) tag("UnitTag")
213-
else if (body.symbol == defn.BooleanClass) tag("BooleanTag")
214-
else if (body.symbol == defn.ByteClass) tag("ByteTag")
215-
else if (body.symbol == defn.CharClass) tag("CharTag")
216-
else if (body.symbol == defn.ShortClass) tag("ShortTag")
217-
else if (body.symbol == defn.IntClass) tag("IntTag")
218-
else if (body.symbol == defn.LongClass) tag("LongTag")
219-
else if (body.symbol == defn.FloatClass) tag("FloatTag")
220-
else if (body.symbol == defn.DoubleClass) tag("DoubleTag")
212+
if (body.symbol.isPrimitiveValueClass) tag(s"${body.symbol.name}Tag")
221213
else pickleAsTasty()
222214
}
223215
else toValue(body) match {

0 commit comments

Comments
 (0)