Skip to content

Commit da9e8ae

Browse files
committed
Drop old extension method syntax
1 parent c4efe8a commit da9e8ae

17 files changed

+93
-93
lines changed

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

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

599-
given ops: (c: Context)
599+
given ops: extension (c: Context) with
600600
def addNotNullInfo(info: NotNullInfo) =
601601
c.withNotNullInfos(c.notNullInfos.extendWith(info))
602602

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ object Nullables with
137137
// TODO: Add constant pattern if the constant type is not nullable
138138
case _ => false
139139

140-
given notNullInfoOps: (infos: List[NotNullInfo])
140+
given notNullInfoOps: extension (infos: List[NotNullInfo]) with
141141

142142
/** Do the current not-null infos imply that `ref` is not null?
143143
* Not-null infos are as a history where earlier assertions and retractions replace
@@ -161,7 +161,7 @@ object Nullables with
161161
then infos
162162
else info :: infos
163163

164-
given treeOps: (tree: Tree)
164+
given treeOps: extension (tree: Tree) with
165165

166166
/* The `tree` with added nullability attachment */
167167
def withNotNullInfo(info: NotNullInfo): tree.type =
@@ -251,7 +251,7 @@ object Nullables with
251251
tree.computeNullable()
252252
}.traverse(tree)
253253

254-
given assignOps: (tree: Assign)
254+
given assignOps: extension (tree: Assign) with
255255
def computeAssignNullable()(given Context): tree.type = tree.lhs match
256256
case TrackedRef(ref) =>
257257
tree.withNotNullInfo(NotNullInfo(Set(), Set(ref))) // TODO: refine with nullability type info

library/src/scala/tasty/reflect/CommentOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package scala.tasty.reflect
22

33
trait CommentOps extends Core {
44

5-
given CommentOps: (self: Comment) {
5+
given CommentOps: extension (self: Comment) {
66

77
/** Raw comment string */
88
def raw: String = internal.Comment_raw(self)

library/src/scala/tasty/reflect/ConstantOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package reflect
33

44
trait ConstantOps extends Core {
55

6-
given ConstantOps: (const: Constant) {
6+
given ConstantOps: extension (const: Constant) {
77
def value: Any = internal.Constant_value(const)
88
}
99

library/src/scala/tasty/reflect/ContextOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package reflect
33

44
trait ContextOps extends Core {
55

6-
given ContextOps: (self: Context) {
6+
given ContextOps: extension (self: Context) {
77
/** Returns the owner of the context */
88
def owner: Symbol = internal.Context_owner(self)
99

library/src/scala/tasty/reflect/FlagsOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package scala.tasty.reflect
22

33
trait FlagsOps extends Core {
44

5-
given FlagsOps: (self: Flags) {
5+
given FlagsOps: extension (self: Flags) {
66

77
/** Is the given flag set a subset of this flag sets */
88
def is(that: Flags): Boolean = internal.Flags_is(self)(that)

library/src/scala/tasty/reflect/IdOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package reflect
33

44
trait IdOps extends Core {
55

6-
given IsOps: (id: Id) {
6+
given IdOps: extension (id: Id) {
77

88
/** Position in the source code */
99
def pos(given ctx: Context): Position = internal.Id_pos(id)

library/src/scala/tasty/reflect/ImplicitsOps.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ trait ImplicitsOps extends Core {
1111
@deprecated("Use _: ImplicitSearchSuccess", "")
1212
def unapply(isr: ImplicitSearchSuccess)(given ctx: Context): Option[ImplicitSearchSuccess] = Some(isr)
1313

14-
given SuccessOps: (self: ImplicitSearchSuccess) {
14+
given successOps: extension (self: ImplicitSearchSuccess) {
1515
def tree(given ctx: Context): Term = internal.ImplicitSearchSuccess_tree(self)
1616
}
1717

@@ -21,7 +21,7 @@ trait ImplicitsOps extends Core {
2121
@deprecated("Use _: ImplicitSearchFailure", "")
2222
def unapply(isr: ImplicitSearchFailure)(given ctx: Context): Option[ImplicitSearchFailure] = Some(isr)
2323

24-
given FailureOps: (self: ImplicitSearchFailure) {
24+
given failureOps: extension (self: ImplicitSearchFailure) {
2525
def explanation(given ctx: Context): String = internal.ImplicitSearchFailure_explanation(self)
2626
}
2727

library/src/scala/tasty/reflect/ImportSelectorOps.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package reflect
33

44
trait ImportSelectorOps extends Core {
55

6-
given SimpleSelectorOps: (self: SimpleSelector) {
6+
given simpleSelectorOps: extension (self: SimpleSelector) {
77
def selection(given ctx: Context): Id =
88
internal.SimpleSelector_selection(self)
99
}
@@ -13,7 +13,7 @@ trait ImportSelectorOps extends Core {
1313
object SimpleSelector
1414
def unapply(x: SimpleSelector)(given ctx: Context): Option[Id] = Some(x.selection)
1515

16-
given RenameSelectorOps: (self: RenameSelector) {
16+
given renameSelectorOps: extension (self: RenameSelector) {
1717
def from(given ctx: Context): Id =
1818
internal.RenameSelector_from(self)
1919

@@ -26,7 +26,7 @@ trait ImportSelectorOps extends Core {
2626
object RenameSelector
2727
def unapply(x: RenameSelector)(given ctx: Context): Option[(Id, Id)] = Some((x.from, x.to))
2828

29-
given OmitSelectorOps: (self: OmitSelector) {
29+
given omitSelectorOps: extension (self: OmitSelector) {
3030
def omitted(given ctx: Context): Id =
3131
internal.SimpleSelector_omitted(self)
3232
}

library/src/scala/tasty/reflect/PositionOps.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package scala.tasty.reflect
22

33
trait PositionOps extends Core {
44

5-
given PositionOps: (pos: Position) {
5+
given positionOps: extension (pos: Position) {
66

77
/** The start offset in the source file */
88
def start: Int = internal.Position_start(pos)
@@ -33,7 +33,7 @@ trait PositionOps extends Core {
3333

3434
}
3535

36-
given SourceFileOps: (sourceFile: SourceFile) {
36+
given sourceFileOps: extension (sourceFile: SourceFile) {
3737

3838
/** Path to this source file */
3939
def jpath: java.nio.file.Path = internal.SourceFile_jpath(sourceFile)

library/src/scala/tasty/reflect/SignatureOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait SignatureOps extends Core {
99
Some((sig.paramSigs, sig.resultSig))
1010
}
1111

12-
given SignatureOps: (sig: Signature) {
12+
given signatureOps: extension (sig: Signature) {
1313

1414
/** The signatures of the method parameters.
1515
*

library/src/scala/tasty/reflect/SymbolOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ trait SymbolOps extends Core { selfSymbolOps: FlagsOps =>
1414
internal.Symbol_noSymbol
1515
}
1616

17-
given SymbolOps: (self: Symbol) {
17+
given symbolOps: extension (self: Symbol) {
1818

1919
/** Owner of this symbol. The owner is the symbol in which this symbol is defined */
2020
def owner(given ctx: Context): Symbol = internal.Symbol_owner(self)

0 commit comments

Comments
 (0)