Skip to content

Commit ca7e169

Browse files
committed
Fix compiler references to NotGiven type
1 parent 28b461f commit ca7e169

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,8 +851,8 @@ class Definitions {
851851
@tu lazy val TypeBox_CAP: TypeSymbol = TypeBoxClass.requiredType(tpnme.CAP)
852852

853853
@tu lazy val MatchCaseClass: ClassSymbol = requiredClass("scala.runtime.MatchCase")
854-
@tu lazy val NotClass: ClassSymbol = requiredClass("scala.util.Not")
855-
@tu lazy val Not_value: Symbol = NotClass.companionModule.requiredMethod(nme.value)
854+
@tu lazy val NotGivenClass: ClassSymbol = requiredClass("scala.util.NotGiven")
855+
@tu lazy val NotGiven_value: Symbol = NotGivenClass.companionModule.requiredMethod(nme.value)
856856

857857
@tu lazy val ValueOfClass: ClassSymbol = requiredClass("scala.ValueOf")
858858

compiler/src/dotty/tools/dotc/typer/Implicits.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ trait Implicits:
10721072
else ViewProto(wildApprox(argument.tpe.widen), wildApprox(pt))
10731073
// Not clear whether we need to drop the `.widen` here. All tests pass with it in place, though.
10741074

1075-
val isNot: Boolean = wildProto.classSymbol == defn.NotClass
1075+
val isNotGiven: Boolean = wildProto.classSymbol == defn.NotGivenClass
10761076

10771077
/** Try to type-check implicit reference, after checking that this is not
10781078
* a diverging search
@@ -1201,10 +1201,10 @@ trait Implicits:
12011201
}
12021202

12031203
def negateIfNot(result: SearchResult) =
1204-
if (isNot)
1204+
if (isNotGiven)
12051205
result match {
12061206
case _: SearchFailure =>
1207-
SearchSuccess(ref(defn.Not_value), defn.Not_value.termRef, 0)(
1207+
SearchSuccess(ref(defn.NotGiven_value), defn.NotGiven_value.termRef, 0)(
12081208
ctx.typerState.fresh().setCommittable(true),
12091209
ctx.gadt
12101210
)
@@ -1220,7 +1220,7 @@ trait Implicits:
12201220
|According to the new implicit resolution rules this is no longer possible;
12211221
|the search will fail with a global ambiguity error instead.
12221222
|
1223-
|Consider using the scala.util.Not class to implement similar functionality.""",
1223+
|Consider using the scala.util.NotGiven class to implement similar functionality.""",
12241224
ctx.source.atSpan(span))
12251225

12261226
/** A relation that influences the order in which implicits are tried.

0 commit comments

Comments
 (0)