Skip to content

Commit b2da1a9

Browse files
committed
added macro-enabling import in nested macro for GADT subtype determining
1 parent 1bb1945 commit b2da1a9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

commons-macros/src/main/scala/com/avsystem/commons/macros/MacroCommons.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,11 +1120,12 @@ trait MacroCommons { bundle =>
11201120
// heavy wizardry employed to trick the compiler into performing the type computation that I need
11211121
val fakeMatch =
11221122
q"""
1123-
def $normName(tpref: $StringCls, value: $ScalaPkg.Any): $ScalaPkg.Any =
1124-
macro $CommonsPkg.macros.misc.WhiteMiscMacros.normalizeGadtSubtype
1125-
($PredefObj.??? : $baseTpe) match {
1126-
case $vname: $matchedTpe => $normName($tpref, $vname)
1127-
}
1123+
import scala.language.experimental.macros
1124+
def $normName(tpref: $StringCls, value: $ScalaPkg.Any): $ScalaPkg.Any =
1125+
macro $CommonsPkg.macros.misc.WhiteMiscMacros.normalizeGadtSubtype
1126+
($PredefObj.??? : $baseTpe) match {
1127+
case $vname: $matchedTpe => $normName($tpref, $vname)
1128+
}
11281129
"""
11291130

11301131
c.typecheck(fakeMatch, silent = !debugEnabled) match {

0 commit comments

Comments
 (0)