@@ -167,11 +167,11 @@ object desugar {
167167 else vdef
168168 }
169169
170- def makeImplicitParameters (tpts : List [Tree ], contextualFlag : FlagSet = EmptyFlags , forPrimaryConstructor : Boolean = false )(implicit ctx : Context ): List [ValDef ] =
170+ def makeImplicitParameters (tpts : List [Tree ], implicitFlag : FlagSet , forPrimaryConstructor : Boolean = false )(implicit ctx : Context ): List [ValDef ] =
171171 for (tpt <- tpts) yield {
172172 val paramFlags : FlagSet = if (forPrimaryConstructor) PrivateLocalParamAccessor else Param
173173 val epname = EvidenceParamName .fresh()
174- ValDef (epname, tpt, EmptyTree ).withFlags(paramFlags | Implicit | contextualFlag )
174+ ValDef (epname, tpt, EmptyTree ).withFlags(paramFlags | implicitFlag )
175175 }
176176
177177 /** 1. Expand context bounds to evidence params. E.g.,
@@ -207,7 +207,7 @@ object desugar {
207207 val epbuf = new ListBuffer [ValDef ]
208208 def desugarContextBounds (rhs : Tree ): Tree = rhs match {
209209 case ContextBounds (tbounds, cxbounds) =>
210- epbuf ++= makeImplicitParameters(cxbounds, forPrimaryConstructor = isPrimaryConstructor)
210+ epbuf ++= makeImplicitParameters(cxbounds, Implicit , forPrimaryConstructor = isPrimaryConstructor)
211211 tbounds
212212 case LambdaTypeTree (tparams, body) =>
213213 cpy.LambdaTypeTree (rhs)(tparams, desugarContextBounds(body))
@@ -310,7 +310,7 @@ object desugar {
310310 meth
311311 case evidenceParams =>
312312 val vparamss1 = meth.vparamss.reverse match {
313- case (vparams @ (vparam :: _)) :: rvparamss if vparam.mods is Implicit =>
313+ case (vparams @ (vparam :: _)) :: rvparamss if vparam.mods is ImplicitOrGiven =>
314314 ((evidenceParams ++ vparams) :: rvparamss).reverse
315315 case _ =>
316316 meth.vparamss :+ evidenceParams
@@ -321,7 +321,7 @@ object desugar {
321321 /** The implicit evidence parameters of `meth`, as generated by `desugar.defDef` */
322322 private def evidenceParams (meth : DefDef )(implicit ctx : Context ): List [ValDef ] =
323323 meth.vparamss.reverse match {
324- case (vparams @ (vparam :: _)) :: _ if vparam.mods is Implicit =>
324+ case (vparams @ (vparam :: _)) :: _ if vparam.mods is ImplicitOrGiven =>
325325 vparams.dropWhile(! _.name.is(EvidenceParamName ))
326326 case _ =>
327327 Nil
@@ -332,7 +332,7 @@ object desugar {
332332 private def toDefParam (tparam : TypeDef ): TypeDef =
333333 tparam.withMods(tparam.rawMods & EmptyFlags | Param )
334334 private def toDefParam (vparam : ValDef ): ValDef =
335- vparam.withMods(vparam.rawMods & (Implicit | Erased ) | Param )
335+ vparam.withMods(vparam.rawMods & (ImplicitOrGiven | Erased ) | Param )
336336
337337 /** The expansion of a class definition. See inline comments for what is involved */
338338 def classDef (cdef : TypeDef )(implicit ctx : Context ): Tree = {
@@ -400,7 +400,7 @@ object desugar {
400400 if (isCaseClass && originalTparams.isEmpty)
401401 ctx.error(CaseClassMissingParamList (cdef), namePos)
402402 ListOfNil
403- } else if (isCaseClass && originalVparamss.head.exists(_.mods.is(Implicit ))) {
403+ } else if (isCaseClass && originalVparamss.head.exists(_.mods.is(ImplicitOrGiven ))) {
404404 ctx.error(" Case classes should have a non-implicit parameter list" , namePos)
405405 ListOfNil
406406 }
@@ -495,7 +495,7 @@ object desugar {
495495 // new C[Ts](paramss)
496496 lazy val creatorExpr = {
497497 val vparamss = constrVparamss match {
498- case (vparam :: _) :: _ if vparam.mods.is(Implicit ) => // add a leading () to match class parameters
498+ case (vparam :: _) :: _ if vparam.mods.is(ImplicitOrGiven ) => // add a leading () to match class parameters
499499 Nil :: constrVparamss
500500 case _ =>
501501 constrVparamss
@@ -856,7 +856,7 @@ object desugar {
856856 */
857857 def normalizeName (mdef : MemberDef , impl : Tree )(implicit ctx : Context ): Name = {
858858 var name = mdef.name
859- if (name.isEmpty) name = name.likeSpaced(s " ${inventName(impl)}_ev " .toTermName)
859+ if (name.isEmpty) name = name.likeSpaced(s " ${inventName(impl)}_instance " .toTermName)
860860 if (ctx.owner == defn.ScalaPackageClass && defn.reservedScalaClassNames.contains(name.toTypeName)) {
861861 def kind = if (name.isTypeName) " class" else " object"
862862 ctx.error(em " illegal redefinition of standard $kind $name" , mdef.sourcePos)
@@ -1178,7 +1178,7 @@ object desugar {
11781178 def makeContextualFunction (formals : List [Type ], body : Tree , isErased : Boolean )(implicit ctx : Context ): Tree = {
11791179 val mods = if (isErased) Given | Erased else Given
11801180 val params = makeImplicitParameters(formals.map(TypeTree ), mods)
1181- new FunctionWithMods (params, body, Modifiers (Implicit | mods))
1181+ new FunctionWithMods (params, body, Modifiers (mods))
11821182 }
11831183
11841184 /** Add annotation to tree:
0 commit comments