@@ -297,8 +297,8 @@ object desugar {
297
297
val isCaseClass = mods.is(Case ) && ! mods.is(Module )
298
298
val isCaseObject = mods.is(Case ) && mods.is(Module )
299
299
val isImplicit = mods.is(Implicit )
300
- val isEnum = mods.hasMod[ Mod . Enum ] && ! mods.is(Module )
301
- val isEnumCase = mods.hasMod[ Mod . EnumCase ]
300
+ val isEnum = mods.isEnumClass && ! mods.is(Module )
301
+ def isEnumCase = mods.isEnumCase
302
302
val isValueClass = parents.nonEmpty && isAnyVal(parents.head)
303
303
// This is not watertight, but `extends AnyVal` will be replaced by `inline` later.
304
304
@@ -641,7 +641,7 @@ object desugar {
641
641
val moduleName = checkNotReservedName(mdef).asTermName
642
642
val impl = mdef.impl
643
643
val mods = mdef.mods
644
- lazy val isEnumCase = mods.hasMod[ Mod . EnumCase ]
644
+ def isEnumCase = mods.isEnumCase
645
645
if (mods is Package )
646
646
PackageDef (Ident (moduleName), cpy.ModuleDef (mdef)(nme.PACKAGE , impl).withMods(mods &~ Package ) :: Nil )
647
647
else if (isEnumCase)
@@ -688,7 +688,7 @@ object desugar {
688
688
*/
689
689
def patDef (pdef : PatDef )(implicit ctx : Context ): Tree = flatTree {
690
690
val PatDef (mods, pats, tpt, rhs) = pdef
691
- if (mods.hasMod[ Mod . EnumCase ] )
691
+ if (mods.isEnumCase )
692
692
pats map {
693
693
case id : Ident =>
694
694
expandSimpleEnumCase(id.name.asTermName, mods,
@@ -810,16 +810,11 @@ object desugar {
810
810
* ==>
811
811
* def $anonfun(params) = body
812
812
* Closure($anonfun)
813
- *
814
- * If `inlineable` is true, tag $anonfun with an @inline annotation.
815
813
*/
816
- def makeClosure (params : List [ValDef ], body : Tree , tpt : Tree = TypeTree (), isInlineable : Boolean , isImplicit : Boolean )(implicit ctx : Context ) = {
817
- var mods = synthetic | Artifact
818
- if (isInlineable) mods |= Inline
814
+ def makeClosure (params : List [ValDef ], body : Tree , tpt : Tree = TypeTree (), isImplicit : Boolean )(implicit ctx : Context ) =
819
815
Block (
820
- DefDef (nme.ANON_FUN , Nil , params :: Nil , tpt, body).withMods(mods ),
816
+ DefDef (nme.ANON_FUN , Nil , params :: Nil , tpt, body).withMods(synthetic | Artifact ),
821
817
Closure (Nil , Ident (nme.ANON_FUN ), if (isImplicit) ImplicitEmptyTree else EmptyTree ))
822
- }
823
818
824
819
/** If `nparams` == 1, expand partial function
825
820
*
0 commit comments