Skip to content

Commit

Permalink
Stop @newtype to warn for implicit conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
marcesquerra committed Apr 17, 2020
1 parent 46775cf commit 60322b6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ private[macros] class NewTypeMacros(val c: blackbox.Context) {

val baseTypeDef = mkBaseTypeDef(clsDef, reprType, subtype)
val typeTypeDef = mkTypeTypeDef(clsDef, tparamNames, subtype)
val enableImplicits = List( q"import _root_.scala.language.implicitConversions" )

val newtypeObjParents = objParents
val newtypeObjDef = ModuleDef(
objMods, objName, Template(newtypeObjParents, objSelf, objDefs ++ companionExtraDefs ++ Seq(
objMods, objName, Template(newtypeObjParents, objSelf, objDefs ++ enableImplicits ++ companionExtraDefs ++ Seq(
q"type Repr[..$tparams] = $reprType",
baseTypeDef,
q"trait Tag[..$tparams] extends _root_.scala.Any",
Expand Down

0 comments on commit 60322b6

Please sign in to comment.