Skip to content

Commit 4f437ae

Browse files
committed
More fixes in code and tests
1 parent 24dc2de commit 4f437ae

File tree

85 files changed

+1226
-1231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1226
-1231
lines changed

compiler/src/dotty/tools/backend/jvm/GenBCode.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ class GenBCodePipeline(val int: DottyBackendInterface)(implicit val ctx: Context
161161
val same = classSymbol.effectiveName.toString == dupClassSym.effectiveName.toString
162162
ctx.atPhase(ctx.typerPhase) {
163163
if (same)
164-
the[Context].warning( // FIXME: This should really be an error, but then FromTasty tests fail
164+
summon[Context].warning( // FIXME: This should really be an error, but then FromTasty tests fail
165165
s"${cl1.show} and ${cl2.showLocated} produce classes that overwrite one another", cl1.sourcePos)
166166
else
167-
the[Context].warning(s"${cl1.show} differs only in case from ${cl2.showLocated}. " +
167+
summon[Context].warning(s"${cl1.show} differs only in case from ${cl2.showLocated}. " +
168168
"Such classes will overwrite one another on case-insensitive filesystems.", cl1.sourcePos)
169169
}
170170
}

compiler/src/dotty/tools/dotc/ast/Desugar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ object desugar {
893893
* If the given member `mdef` is not of this form, flag it as an error.
894894
*/
895895

896-
def makeExtensionDef(mdef: Tree, tparams: List[TypeDef], leadingParams: List[ValDef]) given (ctx: Context): Tree = {
896+
def makeExtensionDef(mdef: Tree, tparams: List[TypeDef], leadingParams: List[ValDef])(given ctx: Context): Tree = {
897897
val allowed = "allowed here, since collective parameters are given"
898898
mdef match {
899899
case mdef: DefDef =>

compiler/src/dotty/tools/dotc/ast/MainProxies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ object MainProxies {
4040
}
4141

4242
import untpd._
43-
def mainProxy(mainFun: Symbol) given (ctx: Context): List[TypeDef] = {
43+
def mainProxy(mainFun: Symbol)(given ctx: Context): List[TypeDef] = {
4444
val mainAnnotSpan = mainFun.getAnnotation(defn.MainAnnot).get.tree.span
4545
def pos = mainFun.sourcePos
4646
val argsRef = Ident(nme.args)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ object Annotations {
121121
def deferred(sym: Symbol)(treeFn: ImplicitFunction1[Context, Tree])(implicit ctx: Context): Annotation =
122122
new LazyAnnotation {
123123
override def symbol(implicit ctx: Context): Symbol = sym
124-
def complete(implicit ctx: Context) = treeFn given ctx
124+
def complete(implicit ctx: Context) = treeFn(given ctx)
125125
}
126126

127127
/** Create an annotation where the symbol and the tree are computed lazily. */
@@ -131,12 +131,12 @@ object Annotations {
131131

132132
override def symbol(implicit ctx: Context): Symbol = {
133133
if (mySym == null || mySym.defRunId != ctx.runId) {
134-
mySym = symf given ctx
134+
mySym = symf(given ctx)
135135
assert(mySym != null)
136136
}
137137
mySym
138138
}
139-
def complete(implicit ctx: Context) = treeFn given ctx
139+
def complete(implicit ctx: Context) = treeFn(given ctx)
140140
}
141141

142142
def deferred(atp: Type, args: List[Tree])(implicit ctx: Context): Annotation =

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ object Decorators {
174174
def (x: T) reporting[T](
175175
op: ImplicitFunction1[WrappedResult[T], String],
176176
printer: config.Printers.Printer = config.Printers.default): T = {
177-
printer.println(op given WrappedResult(x))
177+
printer.println(op(given WrappedResult(x)))
178178
x
179179
}
180180
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ abstract class Periods { self: Context =>
2222

2323
/** Execute `op` at given phase id */
2424
def atPhase[T](pid: PhaseId)(op: ImplicitFunction1[Context, T]): T =
25-
op given ctx.withPhase(pid)
25+
op(given ctx.withPhase(pid))
2626

2727
/** The period containing the current period where denotations do not change.
2828
* We compute this by taking as first phase the first phase less or equal to

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ trait Phases {
3737
def atNextPhase[T](op: ImplicitFunction1[Context, T]): T = atPhase(phase.next)(op)
3838

3939
def atPhaseNotLaterThan[T](limit: Phase)(op: ImplicitFunction1[Context, T]): T =
40-
if (!limit.exists || phase <= limit) op given this else atPhase(limit)(op)
40+
if (!limit.exists || phase <= limit) op(given this) else atPhase(limit)(op)
4141

4242
def isAfterTyper: Boolean = base.isAfterTyper(phase)
4343
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ object Signature {
167167
y match {
168168
case y: TypeName =>
169169
// `Ordering[TypeName]` doesn't work due to `Ordering` still being invariant
170-
the[Ordering[Name]].compare(x, y)
170+
summon[Ordering[Name]].compare(x, y)
171171
case y: Int =>
172172
1
173173
}
@@ -184,7 +184,7 @@ object Signature {
184184
import scala.math.Ordering.Implicits.seqOrdering
185185
val paramsOrdering = seqOrdering(paramSigOrdering).compare(x.paramsSig, y.paramsSig)
186186
if (paramsOrdering != 0) paramsOrdering
187-
else the[Ordering[Name]].compare(x.resSig, y.resSig)
187+
else summon[Ordering[Name]].compare(x.resSig, y.resSig)
188188
}
189189
}
190190
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class TypeComparer(initctx: Context) extends ConstraintHandling[AbsentContext] w
195195
//}
196196
assert(!ctx.settings.YnoDeepSubtypes.value)
197197
if (Config.traceDeepSubTypeRecursions && !this.isInstanceOf[ExplainingTypeComparer])
198-
ctx.log(TypeComparer.explained(the[Context].typeComparer.isSubType(tp1, tp2, approx)))
198+
ctx.log(TypeComparer.explained(summon[Context].typeComparer.isSubType(tp1, tp2, approx)))
199199
}
200200
// Eliminate LazyRefs before checking whether we have seen a type before
201201
val normalize = new TypeMap {
@@ -2309,7 +2309,7 @@ object TypeComparer {
23092309
/** Show trace of comparison operations when performing `op` */
23102310
def explaining[T](say: String => Unit)(op: ImplicitFunction1[Context, T])(implicit ctx: Context): T = {
23112311
val nestedCtx = ctx.fresh.setTypeComparerFn(new ExplainingTypeComparer(_))
2312-
val res = try { op given nestedCtx } finally { say(nestedCtx.typeComparer.lastTrace()) }
2312+
val res = try { op(given nestedCtx) } finally { say(nestedCtx.typeComparer.lastTrace()) }
23132313
res
23142314
}
23152315

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class TyperState(private val previous: TyperState /* | Null */) {
9898
*/
9999
def test[T](op: ImplicitFunction1[Context, T])(implicit ctx: Context): T =
100100
if (isShared)
101-
op given ctx.fresh.setExploreTyperState()
101+
op(given ctx.fresh.setExploreTyperState())
102102
else {
103103
val savedConstraint = myConstraint
104104
val savedReporter = myReporter
@@ -113,7 +113,7 @@ class TyperState(private val previous: TyperState /* | Null */) {
113113
testReporter.inUse = true
114114
testReporter
115115
}
116-
try op given ctx
116+
try op(given ctx)
117117
finally {
118118
testReporter.inUse = false
119119
resetConstraintTo(savedConstraint)

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ class TreeUnpickler(reader: TastyReader,
12711271
val args = until(end)(readTerm())
12721272
val splice = splices(idx)
12731273
def wrap(arg: Tree) =
1274-
if (arg.isTerm) given (qctx: scala.quoted.QuoteContext) => new TastyTreeExpr(arg, QuoteContext.scopeId)
1274+
if (arg.isTerm) (given qctx: scala.quoted.QuoteContext) => new TastyTreeExpr(arg, QuoteContext.scopeId)
12751275
else new TreeType(arg, QuoteContext.scopeId)
12761276
val reifiedArgs = args.map(wrap)
12771277
val filled = if (isType) {
@@ -1280,7 +1280,7 @@ class TreeUnpickler(reader: TastyReader,
12801280
}
12811281
else {
12821282
val splice1 = splice.asInstanceOf[Seq[Any] => ImplicitFunction1[scala.quoted.QuoteContext, quoted.Expr[?]]]
1283-
val quotedExpr = splice1(reifiedArgs) given dotty.tools.dotc.quoted.QuoteContext()
1283+
val quotedExpr = splice1(reifiedArgs)(given dotty.tools.dotc.quoted.QuoteContext())
12841284
PickledQuotes.quotedExprToTree(quotedExpr)
12851285
}
12861286
// We need to make sure a hole is created with the source file of the surrounding context, even if

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
979979
val atp = readTypeRef()
980980
val phase = ctx.phase
981981
Annotation.deferred(atp.typeSymbol)(
982-
atReadPos(start, () => readAnnotationContents(end)(the[Context].withPhase(phase))))
982+
atReadPos(start, () => readAnnotationContents(end)(summon[Context].withPhase(phase))))
983983
}
984984

985985
/* Read an abstract syntax tree */

compiler/src/dotty/tools/dotc/interactive/Interactive.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ object Interactive {
379379
def localize(symbol: Symbol, sourceDriver: InteractiveDriver, targetDriver: InteractiveDriver): Symbol = {
380380

381381
def in[T](driver: InteractiveDriver)(fn: ImplicitFunction1[Context, T]): T =
382-
fn given driver.currentCtx
382+
fn(given driver.currentCtx)
383383

384384
if (sourceDriver == targetDriver) symbol
385385
else {

compiler/src/dotty/tools/dotc/printing/Formatting.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ object Formatting {
254254
*/
255255
def explained(op: ImplicitFunction1[Context, String])(implicit ctx: Context): String = {
256256
val seen = new Seen
257-
val msg = op given explainCtx(seen)
257+
val msg = op(given explainCtx(seen))
258258
val addendum = explanations(seen)
259259
if (addendum.isEmpty) msg else msg ++ "\n\n" ++ addendum
260260
}

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,10 +764,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
764764
"[" ~ toText(params, ", ") ~ "]" provided params.nonEmpty
765765

766766
def addVparamssText[T >: Untyped](leading: Text, vparamss: List[List[ValDef[T]]]): Text =
767-
vparamss.foldLeft(leading)((txt, params) =>
768-
txt ~
769-
(Str(" given ") provided params.nonEmpty && params.head.mods.is(Given)) ~
770-
paramsText(params))
767+
vparamss.foldLeft(leading)((txt, params) => txt ~ paramsText(params))
771768

772769
protected def valDefToText[T >: Untyped](tree: ValDef[T]): Text = {
773770
import untpd.{modsDeco => _}

compiler/src/dotty/tools/dotc/quoted/QuoteContext.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import dotty.tools.dotc.tastyreflect.ReflectionImpl
66
object QuoteContext {
77

88
def apply()(given Context): scala.quoted.QuoteContext =
9-
new scala.quoted.QuoteContext(ReflectionImpl(the[Context]))
9+
new scala.quoted.QuoteContext(ReflectionImpl(summon[Context]))
1010

1111
type ScopeId = Int
1212

@@ -17,5 +17,5 @@ object QuoteContext {
1717
// TODO Explore more fine grained scope ids.
1818
// This id can only differentiate scope extrusion from one compiler instance to another.
1919
private[dotty] def scopeId(given Context): ScopeId =
20-
the[Context].outersIterator.toList.last.hashCode()
20+
summon[Context].outersIterator.toList.last.hashCode()
2121
}

compiler/src/dotty/tools/dotc/reporting/Reporter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ abstract class Reporter extends interfaces.ReporterResult {
252252

253253
/** Run `op` and return `true` if errors were reported by this reporter.
254254
*/
255-
def reportsErrorsFor(op: Context => Unit) given (ctx: Context): Boolean = {
255+
def reportsErrorsFor(op: Context => Unit)(given ctx: Context): Boolean = {
256256
val initial = errorCount
257257
op(ctx)
258258
errorCount > initial

compiler/src/dotty/tools/dotc/rewrites/Rewrites.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ object Rewrites {
7575
patch(ctx.compilationUnit.source, span, replacement)
7676

7777
/** Does `span` overlap with a patch region of `source`? */
78-
def overlapsPatch(source: SourceFile, span: Span) given (ctx: Context): Boolean =
78+
def overlapsPatch(source: SourceFile, span: Span)(given ctx: Context): Boolean =
7979
ctx.settings.rewrite.value.exists(rewrites =>
8080
rewrites.patched.get(source).exists(patches =>
8181
patches.pbuf.exists(patch => patch.span.overlaps(span))))

compiler/src/dotty/tools/dotc/tastyreflect/ReflectionCompilerInterface.scala

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
6161
// REPORTING
6262
//
6363

64-
def error(msg: => String, pos: Position) given (ctx: Context): Unit =
64+
def error(msg: => String, pos: Position)(given ctx: Context): Unit =
6565
ctx.error(msg, pos)
6666

67-
def error(msg: => String, sourceFile: SourceFile, start: Int, end: Int) given (ctx: Context): Unit =
67+
def error(msg: => String, sourceFile: SourceFile, start: Int, end: Int)(given ctx: Context): Unit =
6868
ctx.error(msg, util.SourcePosition(sourceFile, util.Spans.Span(start, end)))
6969

70-
def warning(msg: => String, pos: Position) given (ctx: Context): Unit =
70+
def warning(msg: => String, pos: Position)(given ctx: Context): Unit =
7171
ctx.warning(msg, pos)
7272

73-
def warning(msg: => String, sourceFile: SourceFile, start: Int, end: Int) given (ctx: Context): Unit =
73+
def warning(msg: => String, sourceFile: SourceFile, start: Int, end: Int)(given ctx: Context): Unit =
7474
ctx.error(msg, util.SourcePosition(sourceFile, util.Spans.Span(start, end)))
7575

7676
//
@@ -589,10 +589,10 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
589589

590590
def Return_expr(self: Return)(given Context): Term = self.expr
591591

592-
def Return_apply(expr: Term) given (ctx: Context): Return =
592+
def Return_apply(expr: Term)(given ctx: Context): Return =
593593
withDefaultPos(tpd.Return(expr, ctx.owner))
594594

595-
def Return_copy(original: Tree)(expr: Term) given (ctx: Context): Return =
595+
def Return_copy(original: Tree)(expr: Term)(given ctx: Context): Return =
596596
tpd.cpy.Return(original)(expr, tpd.ref(ctx.owner))
597597

598598
type Repeated = tpd.SeqLiteral
@@ -1001,7 +1001,7 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
10011001

10021002
def Pattern_TypeTest_tpt(self: TypeTest)(given Context): TypeTree = self.tpt
10031003

1004-
def Pattern_TypeTest_module_apply(tpt: TypeTree) given (ctx: Context): TypeTest =
1004+
def Pattern_TypeTest_module_apply(tpt: TypeTree)(given ctx: Context): TypeTest =
10051005
withDefaultPos(tpd.Typed(untpd.Ident(nme.WILDCARD)(ctx.source).withType(tpt.tpe), tpt))
10061006

10071007
def Pattern_TypeTest_module_copy(original: TypeTest)(tpt: TypeTree)(given Context): TypeTest =
@@ -1047,7 +1047,7 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
10471047
case _ => Some(x)
10481048
}
10491049

1050-
def Type_apply(clazz: Class[?]) given (ctx: Context): Type =
1050+
def Type_apply(clazz: Class[?])(given ctx: Context): Type =
10511051
if (clazz.isPrimitive)
10521052
if (clazz == classOf[Boolean]) defn.BooleanType
10531053
else if (clazz == classOf[Byte]) defn.ByteType
@@ -1476,11 +1476,11 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
14761476

14771477
def Symbol_pos(self: Symbol)(given Context): Position = self.sourcePos
14781478

1479-
def Symbol_localContext(self: Symbol) given (ctx: Context): Context =
1479+
def Symbol_localContext(self: Symbol)(given ctx: Context): Context =
14801480
if (self.exists) ctx.withOwner(self)
14811481
else ctx
14821482

1483-
def Symbol_comment(self: Symbol) given (ctx: Context): Option[Comment] = {
1483+
def Symbol_comment(self: Symbol)(given ctx: Context): Option[Comment] = {
14841484
import dotty.tools.dotc.core.Comments.CommentsContext
14851485
val docCtx = ctx.docCtx.getOrElse {
14861486
throw new RuntimeException(
@@ -1583,7 +1583,7 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
15831583

15841584
private def isField(sym: Symbol)(given Context): Boolean = sym.isTerm && !sym.is(Flags.Method)
15851585

1586-
def ClassDefSymbol_of(fullName: String) given (ctx: Context): ClassDefSymbol = ctx.requiredClass(fullName)
1586+
def ClassDefSymbol_of(fullName: String)(given ctx: Context): ClassDefSymbol = ctx.requiredClass(fullName)
15871587

15881588
type TypeDefSymbol = core.Symbols.TypeSymbol
15891589

@@ -1713,7 +1713,7 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
17131713
PickledQuotes.quotedTypeToTree(self)
17141714

17151715
/** Convert `Term` to an `quoted.Expr[Any]` */
1716-
def QuotedExpr_seal(self: Term) given (ctx: Context): scala.quoted.Expr[Any] = {
1716+
def QuotedExpr_seal(self: Term)(given ctx: Context): scala.quoted.Expr[Any] = {
17171717
def etaExpand(term: Term): Term = term.tpe.widen match {
17181718
case mtpe: Types.MethodType if !mtpe.isParamDependent =>
17191719
val closureResType = mtpe.resType match {
@@ -1729,7 +1729,7 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
17291729
}
17301730

17311731
/** Checked cast to a `quoted.Expr[U]` */
1732-
def QuotedExpr_cast[U](self: scala.quoted.Expr[?]) given (tp: scala.quoted.Type[U], ctx: Context): scala.quoted.Expr[U] = {
1732+
def QuotedExpr_cast[U](self: scala.quoted.Expr[?])(given tp: scala.quoted.Type[U], ctx: Context): scala.quoted.Expr[U] = {
17331733
val tree = QuotedExpr_unseal(self)
17341734
val expectedType = QuotedType_unseal(tp).tpe
17351735
if (tree.tpe <:< expectedType)
@@ -1743,7 +1743,7 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
17431743
}
17441744

17451745
/** Convert `Type` to an `quoted.Type[?]` */
1746-
def QuotedType_seal(self: Type) given (ctx: Context): scala.quoted.Type[?] = {
1746+
def QuotedType_seal(self: Type)(given ctx: Context): scala.quoted.Type[?] = {
17471747
val dummySpan = ctx.owner.span // FIXME
17481748
new scala.internal.quoted.TreeType(tpd.TypeTree(self).withSpan(dummySpan), compilerId)
17491749
}
@@ -1832,7 +1832,7 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
18321832

18331833
type ImplicitSearchResult = Tree
18341834

1835-
def searchImplicit(tpe: Type) given (ctx: Context): ImplicitSearchResult =
1835+
def searchImplicit(tpe: Type)(given ctx: Context): ImplicitSearchResult =
18361836
ctx.typer.inferImplicitArg(tpe, rootPosition.span)
18371837

18381838
type ImplicitSearchSuccess = Tree
@@ -1868,7 +1868,7 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
18681868
case _ => None
18691869
}
18701870

1871-
def betaReduce(fn: Term, args: List[Term]) given (ctx: Context): Term = {
1871+
def betaReduce(fn: Term, args: List[Term])(given ctx: Context): Term = {
18721872
val (argVals0, argRefs0) = args.foldLeft((List.empty[ValDef], List.empty[Tree])) { case ((acc1, acc2), arg) => arg.tpe match {
18731873
case tpe: SingletonType if isIdempotentExpr(arg) => (acc1, arg :: acc2)
18741874
case _ =>
@@ -1904,8 +1904,8 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
19041904
private def optional[T <: Trees.Tree[?]](tree: T): Option[tree.type] =
19051905
if (tree.isEmpty) None else Some(tree)
19061906

1907-
private def withDefaultPos[T <: Tree](fn: ImplicitFunction1[Context, T]) given (ctx: Context): T =
1908-
(fn given ctx.withSource(rootPosition.source)).withSpan(rootPosition.span)
1907+
private def withDefaultPos[T <: Tree](fn: ImplicitFunction1[Context, T])(given ctx: Context): T =
1908+
(fn(given ctx.withSource(rootPosition.source)).withSpan(rootPosition.span))
19091909

19101910
private def compilerId: Int = rootContext.outersIterator.toList.last.hashCode()
19111911
}

compiler/src/dotty/tools/dotc/tastyreflect/ReflectionImpl.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ object ReflectionImpl {
1818
val syntaxHighlight =
1919
if (ctx.settings.color.value == "always") SyntaxHighlight.ANSI
2020
else SyntaxHighlight.plain
21-
new refl.SourceCodePrinter(syntaxHighlight).showTree(reflTree) given reflCtx
21+
new refl.SourceCodePrinter(syntaxHighlight).showTree(reflTree)(given reflCtx)
2222
}
2323
}
2424

compiler/src/dotty/tools/dotc/transform/CtxLazy.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CtxLazy[T](expr: ImplicitFunction1[Context, T]) {
1616
private[this] var forced = false
1717
def apply()(implicit ctx: Context): T = {
1818
if (!forced) {
19-
myValue = expr given ctx
19+
myValue = expr(given ctx)
2020
forced = true
2121
}
2222
myValue

compiler/src/dotty/tools/dotc/transform/PCPCheckAndHeal.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
4040
case tree: DefDef if tree.symbol.is(Inline) && level > 0 => EmptyTree
4141
case tree: DefTree =>
4242
for (annot <- tree.symbol.annotations)
43-
transform(annot.tree) given ctx.withOwner(tree.symbol)
43+
transform(annot.tree)(given ctx.withOwner(tree.symbol))
4444
checkLevel(super.transform(tree))
4545
case _ => checkLevel(super.transform(tree))
4646
}
@@ -215,7 +215,7 @@ class PCPCheckAndHeal(@constructorOnly ictx: Context) extends TreeMapWithStages(
215215
if (!tp.isInstanceOf[ThisType]) sym.show
216216
else if (sym.is(ModuleClass)) sym.sourceModule.show
217217
else i"${sym.name}.this"
218-
the[Context].error(
218+
summon[Context].error(
219219
em"""access to $symStr from wrong staging level:
220220
| - the definition is at level ${levelOf(sym).getOrElse(0)},
221221
| - but the access is at level $level.$errMsg""", pos)

0 commit comments

Comments
 (0)