Skip to content

Simplify implicit flags #6497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
May 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
aaa0cf1
Make `given` come last in instance definitions
odersky May 9, 2019
feb6c47
Make pathTo work for overlapping ranges
odersky May 9, 2019
753801e
Weaken checkPos
odersky May 9, 2019
8a815d2
Tweak NavigateAST.toPath
odersky May 9, 2019
1483ce2
Use correct flags for anonymous given parameters in classes
odersky May 10, 2019
cc83589
Fix printing of given arguments
odersky May 10, 2019
90132d1
Allow given in constructor applications
odersky May 10, 2019
4eb6095
Change syntax of ConstrApps
odersky May 10, 2019
76a8fd4
New flag Exported for export forwarders
odersky May 10, 2019
b2dce61
Use `nullLiteral` utility method
odersky May 10, 2019
8666c0b
Cache right hand side of parameterless alias implicits
odersky May 10, 2019
648d60b
Update docs
odersky May 10, 2019
67fcf92
Define `the` with a given clause
odersky May 14, 2019
b626dc9
Updates to contextual/* docs
odersky May 14, 2019
ded71bb
Print `given` clauses.
odersky May 14, 2019
659e1f1
Use `given` as necessary in creator expressions
odersky May 14, 2019
13ac0c4
Make `given` clauses come last
odersky May 14, 2019
d00b123
Make implicit flags disjoint
odersky May 11, 2019
a6438cd
Bump Tasty format
odersky May 12, 2019
bcfebf8
Use implicit flag unions where possible
odersky May 12, 2019
ffc5b6f
Use `Implied` instead of `Implicit` for implicit matches
odersky May 12, 2019
c6132fa
Merge only method types of the same kind
odersky May 12, 2019
dfa6414
Renamings and simplifications
odersky May 14, 2019
2f38758
Clarify methodTypeTag
odersky May 14, 2019
107ccfd
Streamline companion selection in MethodType
odersky May 14, 2019
7b4be99
Rename isContextual -> isGivenApply
odersky May 14, 2019
eebc21e
Rename isContextual -> isContextualMethod
odersky May 14, 2019
f2c80b2
Drop markContextual in PrepareInline
odersky May 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Compiler {
new ExpandSAMs, // Expand single abstract method closures to anonymous classes
new ProtectedAccessors, // Add accessors for protected members
new ExtensionMethods, // Expand methods of value classes with extension methods
new CacheAliasImplicits, // Cache RHS of parameterless alias implicits
new ShortcutImplicits, // Allow implicit functions without creating closures
new ByNameClosures, // Expand arguments to by-name parameters to closures
new HoistSuperArgs, // Hoist complex arguments of supercalls to enclosing scope
Expand Down
29 changes: 18 additions & 11 deletions compiler/src/dotty/tools/dotc/ast/Desugar.scala
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,17 @@ object desugar {
vparamss = (setterParam :: Nil) :: Nil,
tpt = TypeTree(defn.UnitType),
rhs = setterRhs
).withMods((mods | Accessor) &~ (CaseAccessor | Implicit | Given | Lazy))
).withMods((mods | Accessor) &~ (CaseAccessor | ImplicitOrGiven | Lazy))
Thicket(vdef, setter)
}
else vdef
}

def makeImplicitParameters(tpts: List[Tree], contextualFlag: FlagSet = EmptyFlags, forPrimaryConstructor: Boolean = false)(implicit ctx: Context): List[ValDef] =
def makeImplicitParameters(tpts: List[Tree], implicitFlag: FlagSet, forPrimaryConstructor: Boolean = false)(implicit ctx: Context): List[ValDef] =
for (tpt <- tpts) yield {
val paramFlags: FlagSet = if (forPrimaryConstructor) PrivateLocalParamAccessor else Param
val epname = EvidenceParamName.fresh()
ValDef(epname, tpt, EmptyTree).withFlags(paramFlags | Implicit | contextualFlag)
ValDef(epname, tpt, EmptyTree).withFlags(paramFlags | implicitFlag)
}

/** 1. Expand context bounds to evidence params. E.g.,
Expand Down Expand Up @@ -207,7 +207,7 @@ object desugar {
val epbuf = new ListBuffer[ValDef]
def desugarContextBounds(rhs: Tree): Tree = rhs match {
case ContextBounds(tbounds, cxbounds) =>
epbuf ++= makeImplicitParameters(cxbounds, forPrimaryConstructor = isPrimaryConstructor)
epbuf ++= makeImplicitParameters(cxbounds, Implicit, forPrimaryConstructor = isPrimaryConstructor)
tbounds
case LambdaTypeTree(tparams, body) =>
cpy.LambdaTypeTree(rhs)(tparams, desugarContextBounds(body))
Expand Down Expand Up @@ -310,7 +310,7 @@ object desugar {
meth
case evidenceParams =>
val vparamss1 = meth.vparamss.reverse match {
case (vparams @ (vparam :: _)) :: rvparamss if vparam.mods is Implicit =>
case (vparams @ (vparam :: _)) :: rvparamss if vparam.mods is ImplicitOrGiven =>
((evidenceParams ++ vparams) :: rvparamss).reverse
case _ =>
meth.vparamss :+ evidenceParams
Expand All @@ -321,7 +321,7 @@ object desugar {
/** The implicit evidence parameters of `meth`, as generated by `desugar.defDef` */
private def evidenceParams(meth: DefDef)(implicit ctx: Context): List[ValDef] =
meth.vparamss.reverse match {
case (vparams @ (vparam :: _)) :: _ if vparam.mods is Implicit =>
case (vparams @ (vparam :: _)) :: _ if vparam.mods is ImplicitOrGiven =>
vparams.dropWhile(!_.name.is(EvidenceParamName))
case _ =>
Nil
Expand All @@ -332,7 +332,7 @@ object desugar {
private def toDefParam(tparam: TypeDef): TypeDef =
tparam.withMods(tparam.rawMods & EmptyFlags | Param)
private def toDefParam(vparam: ValDef): ValDef =
vparam.withMods(vparam.rawMods & (Implicit | Erased) | Param)
vparam.withMods(vparam.rawMods & (ImplicitOrGiven | Erased) | Param)

/** The expansion of a class definition. See inline comments for what is involved */
def classDef(cdef: TypeDef)(implicit ctx: Context): Tree = {
Expand Down Expand Up @@ -400,7 +400,7 @@ object desugar {
if (isCaseClass && originalTparams.isEmpty)
ctx.error(CaseClassMissingParamList(cdef), namePos)
ListOfNil
} else if (isCaseClass && originalVparamss.head.exists(_.mods.is(Implicit))) {
} else if (isCaseClass && originalVparamss.head.exists(_.mods.is(ImplicitOrGiven))) {
ctx.error("Case classes should have a non-implicit parameter list", namePos)
ListOfNil
}
Expand Down Expand Up @@ -495,12 +495,19 @@ object desugar {
// new C[Ts](paramss)
lazy val creatorExpr = {
val vparamss = constrVparamss match {
case (vparam :: _) :: _ if vparam.mods.is(Implicit) => // add a leading () to match class parameters
case (vparam :: _) :: _ if vparam.mods.is(ImplicitOrGiven) => // add a leading () to match class parameters
Nil :: constrVparamss
case _ =>
constrVparamss
}
New(classTypeRef, vparamss.nestedMap(refOfDef))
val nu = (makeNew(classTypeRef) /: vparamss) { (nu, vparams) =>
val app = Apply(nu, vparams.map(refOfDef))
vparams match {
case vparam :: _ if vparam.mods.is(Given) => app.setGivenApply()
case _ => app
}
}
ensureApplied(nu)
}

val copiedAccessFlags = if (ctx.scala2Setting) EmptyFlags else AccessFlags
Expand Down Expand Up @@ -1169,7 +1176,7 @@ object desugar {
def makeContextualFunction(formals: List[Type], body: Tree, isErased: Boolean)(implicit ctx: Context): Tree = {
val mods = if (isErased) Given | Erased else Given
val params = makeImplicitParameters(formals.map(TypeTree), mods)
new FunctionWithMods(params, body, Modifiers(Implicit | mods))
new FunctionWithMods(params, body, Modifiers(mods))
}

/** Add annotation to tree:
Expand Down
9 changes: 7 additions & 2 deletions compiler/src/dotty/tools/dotc/ast/NavigateAST.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,21 @@ object NavigateAST {
*/
def pathTo(span: Span, from: Positioned, skipZeroExtent: Boolean = false)(implicit ctx: Context): List[Positioned] = {
def childPath(it: Iterator[Any], path: List[Positioned]): List[Positioned] = {
var bestFit: List[Positioned] = path
while (it.hasNext) {
val path1 = it.next() match {
case p: Positioned => singlePath(p, path)
case m: untpd.Modifiers => childPath(m.productIterator, path)
case xs: List[_] => childPath(xs.iterator, path)
case _ => path
}
if (path1 ne path) return path1
if ((path1 ne path) &&
((bestFit eq path) ||
bestFit.head.span != path1.head.span &&
bestFit.head.span.contains(path1.head.span)))
bestFit = path1
}
path
bestFit
}
def singlePath(p: Positioned, path: List[Positioned]): List[Positioned] =
if (p.span.exists && !(skipZeroExtent && p.span.isZeroExtent) && p.span.contains(span)) {
Expand Down
7 changes: 6 additions & 1 deletion compiler/src/dotty/tools/dotc/ast/Positioned.scala
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ abstract class Positioned(implicit @constructorOnly src: SourceFile) extends Pro
}
}

/** A hook that can be overridden if overlap checking in `checkPos` should be
* disabled for this node.
*/
def disableOverlapChecks = false

/** Check that all positioned items in this tree satisfy the following conditions:
* - Parent spans contain child spans
* - If item is a non-empty tree, it has a position
Expand All @@ -169,7 +174,7 @@ abstract class Positioned(implicit @constructorOnly src: SourceFile) extends Pro
s"position error: position not set for $tree # ${tree.uniqueId}")
case _ =>
}
if (nonOverlapping) {
if (nonOverlapping && !disableOverlapChecks) {
this match {
case _: XMLBlock =>
// FIXME: Trees generated by the XML parser do not satisfy `checkPos`
Expand Down
11 changes: 10 additions & 1 deletion compiler/src/dotty/tools/dotc/ast/Trees.scala
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,8 @@ object Trees {
extends GenericApply[T] {
type ThisTree[-T >: Untyped] = Apply[T]

def isContextual = getAttachment(untpd.ApplyGiven).nonEmpty
def isGivenApply = getAttachment(untpd.ApplyGiven).nonEmpty
def setGivenApply() = { pushAttachment(untpd.ApplyGiven, ()); this }
}

/** fun[args] */
Expand Down Expand Up @@ -746,6 +747,10 @@ object Trees {
assert(tpt != genericEmptyTree)
def unforced: LazyTree = preRhs
protected def force(x: AnyRef): Unit = preRhs = x

override def disableOverlapChecks = rawMods.is(Flags.Implied)
// disable order checks for implicit aliases since their given clause follows
// their for clause, but the two appear swapped in the DefDef.
}

class BackquotedDefDef[-T >: Untyped] private[ast] (name: TermName, tparams: List[TypeDef[T]],
Expand Down Expand Up @@ -783,6 +788,10 @@ object Trees {

def parents: List[Tree[T]] = parentsOrDerived // overridden by DerivingTemplate
def derived: List[untpd.Tree] = Nil // overridden by DerivingTemplate

override def disableOverlapChecks = true
// disable overlaps checks since templates of instance definitions have their
// `given` clause come last, which means that the constructor span can contain the parent spans.
}


Expand Down
9 changes: 6 additions & 3 deletions compiler/src/dotty/tools/dotc/ast/tpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
def unitLiteral(implicit ctx: Context): Literal =
Literal(Constant(()))

def nullLiteral(implicit ctx: Context): Literal =
Literal(Constant(null))

def New(tpt: Tree)(implicit ctx: Context): New =
ta.assignType(untpd.New(tpt), tpt)

Expand Down Expand Up @@ -228,7 +231,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {

def valueParam(name: TermName, origInfo: Type): TermSymbol = {
val maybeImplicit =
if (tp.isContextual) Implicit | Given
if (tp.isContextualMethod) Given
else if (tp.isImplicitMethod) Implicit
else EmptyFlags
val maybeErased = if (tp.isErasedMethod) Erased else EmptyFlags
Expand Down Expand Up @@ -496,7 +499,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
else if (tpw isRef defn.DoubleClass) Literal(Constant(0d))
else if (tpw isRef defn.ByteClass) Literal(Constant(0.toByte))
else if (tpw isRef defn.ShortClass) Literal(Constant(0.toShort))
else Literal(Constant(null)).select(defn.Any_asInstanceOf).appliedToType(tpe)
else nullLiteral.select(defn.Any_asInstanceOf).appliedToType(tpe)
}

private class FindLocalDummyAccumulator(cls: ClassSymbol)(implicit ctx: Context) extends TreeAccumulator[Symbol] {
Expand Down Expand Up @@ -915,7 +918,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
Typed(tree, TypeTree(defn.AnyRefType))
}
else tree.ensureConforms(defn.ObjectType)
receiver.select(defn.Object_ne).appliedTo(Literal(Constant(null)))
receiver.select(defn.Object_ne).appliedTo(nullLiteral)
}

/** If inititializer tree is `_', the default value of its type,
Expand Down
21 changes: 13 additions & 8 deletions compiler/src/dotty/tools/dotc/ast/untpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
override def isType: Boolean = body.isType
}

/** A function type with `implicit`, `erased`, or `contextual` modifiers */
/** A function type with `implicit`, `erased`, or `given` modifiers */
class FunctionWithMods(args: List[Tree], body: Tree, val mods: Modifiers)(implicit @constructorOnly src: SourceFile)
extends Function(args, body)

Expand Down Expand Up @@ -134,7 +134,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {

case class Implicit()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Implicit)

case class Given()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Implicit | Flags.Given)
case class Given()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Given)

case class Erased()(implicit @constructorOnly src: SourceFile) extends Mod(Flags.Erased)

Expand Down Expand Up @@ -343,7 +343,13 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
* navigation into these arguments from the IDE, and to do the right thing in
* PrepareInlineable.
*/
def New(tpt: Tree, argss: List[List[Tree]])(implicit ctx: Context): Tree = {
def New(tpt: Tree, argss: List[List[Tree]])(implicit ctx: Context): Tree =
ensureApplied((makeNew(tpt) /: argss)(Apply(_, _)))

/** A new expression with constrictor and possibly type arguments. See
* `New(tpt, argss)` for details.
*/
def makeNew(tpt: Tree)(implicit ctx: Context): Tree = {
val (tycon, targs) = tpt match {
case AppliedTypeTree(tycon, targs) =>
(tycon, targs)
Expand All @@ -354,9 +360,8 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
case _ =>
(tpt, Nil)
}
var prefix: Tree = Select(New(tycon), nme.CONSTRUCTOR)
if (targs.nonEmpty) prefix = TypeApply(prefix, targs)
ensureApplied((prefix /: argss)(Apply(_, _)))
val nu: Tree = Select(New(tycon), nme.CONSTRUCTOR)
if (targs.nonEmpty) TypeApply(nu, targs) else nu
}

def Block(stat: Tree, expr: Tree)(implicit src: SourceFile): Block =
Expand Down Expand Up @@ -415,9 +420,9 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
vdef.withMods(mods | Param)
}

def makeSyntheticParameter(n: Int = 1, tpt: Tree = null, flags: FlagSet = EmptyFlags)(implicit ctx: Context): ValDef =
def makeSyntheticParameter(n: Int = 1, tpt: Tree = null, flags: FlagSet = SyntheticTermParam)(implicit ctx: Context): ValDef =
ValDef(nme.syntheticParamName(n), if (tpt == null) TypeTree() else tpt, EmptyTree)
.withFlags(flags | SyntheticTermParam)
.withFlags(flags)

def lambdaAbstract(tparams: List[TypeDef], tpt: Tree)(implicit ctx: Context): Tree =
if (tparams.isEmpty) tpt else LambdaTypeTree(tparams, tpt)
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/Contexts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Scopes._
import Uniques._
import ast.Trees._
import ast.untpd
import Flags.ImplicitOrImplied
import Flags.ImplicitOrImpliedOrGiven
import util.{FreshNameCreator, NoSource, SimpleIdentityMap, SourceFile}
import typer.{Implicits, ImportInfo, Inliner, NamerContextOps, SearchHistory, SearchRoot, TypeAssigner, Typer}
import Implicits.ContextualImplicits
Expand Down Expand Up @@ -214,7 +214,7 @@ object Contexts {
implicitsCache = {
val implicitRefs: List[ImplicitRef] =
if (isClassDefContext)
try owner.thisType.implicitMembers(ImplicitOrImplied)
try owner.thisType.implicitMembers(ImplicitOrImpliedOrGiven)
catch {
case ex: CyclicReference => Nil
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/Definitions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ class Definitions {
enterTypeParam(cls, paramNamePrefix ++ "T" ++ (i + 1).toString, Contravariant, decls).typeRef
}
val resParamRef = enterTypeParam(cls, paramNamePrefix ++ "R", Covariant, decls).typeRef
val methodType = MethodType.maker(
val methodType = MethodType.companion(
isJava = false,
isImplicit = name.isImplicitFunction,
isContextual = name.isImplicitFunction,
isImplicit = false,
isErased = name.isErasedFunction)
decls.enter(newMethod(cls, nme.apply, methodType(argParamRefs, resParamRef), Deferred))
denot.info =
Expand Down
7 changes: 3 additions & 4 deletions compiler/src/dotty/tools/dotc/core/Denotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,8 @@ object Denotations {
tp2 match {
case tp2: PolyType =>
tp1
case tp2: MethodType if ctx.typeComparer.matchingMethodParams(tp1, tp2) &&
tp1.isImplicitMethod == tp2.isImplicitMethod =>
case tp2: MethodType
if ctx.typeComparer.matchingMethodParams(tp1, tp2) && (tp1.companion eq tp2.companion) =>
tp1.derivedLambdaType(
mergeParamNames(tp1, tp2),
tp1.paramInfos,
Expand Down Expand Up @@ -683,8 +683,7 @@ object Denotations {
case tp1: MethodType =>
tp2 match {
case tp2: MethodType
if ctx.typeComparer.matchingMethodParams(tp1, tp2) &&
tp1.isImplicitMethod == tp2.isImplicitMethod =>
if ctx.typeComparer.matchingMethodParams(tp1, tp2) && (tp1.companion eq tp2.companion) =>
tp1.derivedLambdaType(
mergeParamNames(tp1, tp2),
tp1.paramInfos,
Expand Down
11 changes: 8 additions & 3 deletions compiler/src/dotty/tools/dotc/core/Flags.scala
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,9 @@ object Flags {
/** Symbol is an enum class or enum case (if used with case) */
final val Enum: FlagSet = commonFlag(40, "<enum>")

/** An export forwarder */
final val Exported: FlagSet = commonFlag(41, "exported")

/** Labeled with `erased` modifier (erased value) */
final val Erased: FlagSet = termFlag(42, "erased")

Expand Down Expand Up @@ -459,7 +462,7 @@ object Flags {

/** Flags representing source modifiers */
private val CommonSourceModifierFlags: FlagSet =
commonFlags(Private, Protected, Final, Case, Implicit, Implied, Override, JavaStatic)
commonFlags(Private, Protected, Final, Case, Implicit, Implied, Given, Override, JavaStatic)

final val TypeSourceModifierFlags: FlagSet =
CommonSourceModifierFlags.toTypeFlags | Abstract | Sealed | Opaque
Expand All @@ -484,7 +487,7 @@ object Flags {
HigherKinded.toCommonFlags | Param | ParamAccessor.toCommonFlags |
Scala2ExistentialCommon | MutableOrOpaque | Touched | JavaStatic |
CovariantOrOuter | ContravariantOrLabel | CaseAccessor.toCommonFlags |
Extension.toCommonFlags | NonMember | Implicit | Implied | Permanent | Synthetic |
Extension.toCommonFlags | NonMember | Implicit | Given | Implied | Permanent | Synthetic |
SuperAccessorOrScala2x | Inline

/** Flags that are not (re)set when completing the denotation, or, if symbol is
Expand Down Expand Up @@ -586,8 +589,10 @@ object Flags {
final val InlineOrProxy: FlagSet = Inline | InlineProxy

final val ImplicitOrImplied = Implicit | Implied
final val ImplicitOrImpliedOrGiven = Implicit | Implied | Given
final val ImplicitOrGiven = Implicit | Given

final val ImplicitOrImpliedTerm = ImplicitOrImplied.toTermFlags
final val ImplicitOrImpliedOrGivenTerm = ImplicitOrImpliedOrGiven.toTermFlags

/** Assumed to be pure */
final val StableOrErased: FlagSet = StableRealizable | Erased
Expand Down
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/core/NameKinds.scala
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ object NameKinds {
val InlineAccessorName: PrefixNameKind = new PrefixNameKind(INLINEACCESSOR, "inline$")

val AvoidClashName: SuffixNameKind = new SuffixNameKind(AVOIDCLASH, "$_avoid_name_clash_$")
val CacheName = new SuffixNameKind(CACHE, "$_cache")
val DirectMethodName: SuffixNameKind = new SuffixNameKind(DIRECT, "$direct") { override def definesNewName = true }
val FieldName: SuffixNameKind = new SuffixNameKind(FIELD, "$$local") {
override def mkString(underlying: TermName, info: ThisInfo) = underlying.toString
Expand Down
2 changes: 2 additions & 0 deletions compiler/src/dotty/tools/dotc/core/NameTags.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ object NameTags extends TastyFormat.NameTags {
final val IMPLMETH = 32 // Used to define methods in implementation classes
// (can probably be removed).

final val CACHE = 33 // Used as a cache for the rhs of an alias implicit.

def nameTagToString(tag: Int): String = tag match {
case UTF8 => "UTF8"
case QUALIFIED => "QUALIFIED"
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/Scopes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ object Scopes {
var irefs = new mutable.ListBuffer[TermRef]
var e = lastEntry
while (e ne null) {
if (e.sym is ImplicitOrImplied) {
if (e.sym is ImplicitOrImpliedOrGiven) {
val d = e.sym.denot
irefs += TermRef(NoPrefix, d.symbol.asTerm).withDenot(d)
}
Expand Down
Loading