Skip to content

Commit e0c6e6f

Browse files
Merge pull request #10613 from dotty-staging/drop-old-given-syntax
Drop old given syntax
2 parents 11f53c7 + d145300 commit e0c6e6f

Some content is hidden

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

57 files changed

+373
-391
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ object DottyBackendInterface {
124124
requiredModule(className)
125125
}
126126

127-
given symExtensions as AnyRef:
127+
given symExtensions: AnyRef with
128128
extension (sym: Symbol):
129129

130130
def isInterface(using Context): Boolean = (sym.is(PureInterface)) || sym.is(Trait)

compiler/src/dotty/tools/backend/sjs/JSExportsGen.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ final class JSExportsGen(jsCodeGen: JSCodeGen)(using Context) {
942942
private case object NoTypeTest extends RTTypeTest
943943

944944
private object RTTypeTest {
945-
given PartialOrdering[RTTypeTest] {
945+
given PartialOrdering[RTTypeTest] with {
946946
override def tryCompare(lhs: RTTypeTest, rhs: RTTypeTest): Option[Int] = {
947947
if (lteq(lhs, rhs)) if (lteq(rhs, lhs)) Some(0) else Some(-1)
948948
else if (lteq(rhs, lhs)) Some(1) else None

compiler/src/dotty/tools/dotc/Run.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class Run(comp: Compiler, ictx: Context) extends ImplicitRunInfo with Constraint
8585
private var myCtx = rootContext(using ictx)
8686

8787
/** The context created for this run */
88-
given runContext[Dummy_so_its_a_def] as Context = myCtx
88+
given runContext[Dummy_so_its_a_def]: Context = myCtx
8989
assert(runContext.runId <= Periods.MaxPossibleRunId)
9090

9191
private var myUnits: List[CompilationUnit] = _

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ object Trees {
15531553
def applyOverloaded(
15541554
receiver: tpd.Tree, method: TermName, args: List[Tree], targs: List[Type],
15551555
expectedType: Type)(using parentCtx: Context): tpd.Tree = {
1556-
given ctx as Context = parentCtx.retractMode(Mode.ImplicitsEnabled)
1556+
given ctx: Context = parentCtx.retractMode(Mode.ImplicitsEnabled)
15571557
import dotty.tools.dotc.ast.tpd.TreeOps
15581558

15591559
val typer = ctx.typer

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ object Comments {
1515
val ContextDoc: Key[ContextDocstrings] = new Key[ContextDocstrings]
1616

1717
/** Decorator for getting docbase out of context */
18-
given CommentsContext as AnyRef:
18+
given CommentsContext: AnyRef with
1919
extension (c: Context) def docCtx: Option[ContextDocstrings] = c.property(ContextDoc)
2020

2121
/** Context for Docstrings, contains basic functionality for getting

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ object Contexts {
649649
def setDebug: this.type = setSetting(base.settings.Ydebug, true)
650650
}
651651

652-
given ops as AnyRef:
652+
given ops: AnyRef with
653653
extension (c: Context):
654654
def addNotNullInfo(info: NotNullInfo) =
655655
c.withNotNullInfos(c.notNullInfos.extendWith(info))

0 commit comments

Comments
 (0)