Skip to content

Commit e11d0c8

Browse files
committed
Update to new extension syntax
1 parent 4d2ef01 commit e11d0c8

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

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

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

602-
given ops: extension (c: Context) with
602+
extension ops on (c: Context) with
603603
def addNotNullInfo(info: NotNullInfo) =
604604
c.withNotNullInfos(c.notNullInfos.extendWith(info))
605605

compiler/src/dotty/tools/dotc/semanticdb/Scala3.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ object Scala3 with
6767

6868
end Symbols
6969

70-
given NameOps: extension (name: Name) with
70+
extension NameOps on (name: Name) with
7171

7272
def isWildcard = name match
7373
case nme.WILDCARD | WILDCARDTypeName => true
@@ -89,7 +89,7 @@ object Scala3 with
8989

9090
end NameOps
9191

92-
given SymbolOps: extension (sym: Symbol) with
92+
extension SymbolOps on (sym: Symbol) with
9393

9494
def ifExists(given Context): Option[Symbol] = if sym.exists then Some(sym) else None
9595

@@ -146,7 +146,7 @@ object Scala3 with
146146
case '/' | '.' | '#' | ']' | ')' => true
147147
case _ => false
148148

149-
given StringOps: extension (symbol: String) with
149+
extension StringOps on (symbol: String) with
150150

151151
def isSymbol: Boolean = !symbol.isEmpty
152152
def isRootPackage: Boolean = RootPackage == symbol
@@ -171,7 +171,7 @@ object Scala3 with
171171

172172
end StringOps
173173

174-
given InfoOps: extension (info: SymbolInformation) with
174+
extension InfoOps on (info: SymbolInformation) with
175175

176176
def isAbstract: Boolean = (info.properties & SymbolInformation.Property.ABSTRACT.value) != 0
177177
def isFinal: Boolean = (info.properties & SymbolInformation.Property.FINAL.value) != 0
@@ -207,7 +207,7 @@ object Scala3 with
207207

208208
end InfoOps
209209

210-
given RangeOps: extension (range: Range) with
210+
extension RangeOps on (range: Range) with
211211
def hasLength = range.endLine > range.startLine || range.endCharacter > range.startCharacter
212212
end RangeOps
213213

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ object Nullables with
160160
// TODO: Add constant pattern if the constant type is not nullable
161161
case _ => false
162162

163-
given notNullInfoOps: extension (infos: List[NotNullInfo]) with
163+
extension notNullInfoOps on (infos: List[NotNullInfo]) with
164164

165165
/** Do the current not-null infos imply that `ref` is not null?
166166
* Not-null infos are as a history where earlier assertions and retractions replace
@@ -191,7 +191,7 @@ object Nullables with
191191
infos.extendWith(NotNullInfo(Set(), mutables))
192192
end notNullInfoOps
193193

194-
given refOps: extension (ref: TermRef) with
194+
extension refOps on (ref: TermRef) with
195195

196196
/** Is the use of a mutable variable out of order
197197
*
@@ -245,7 +245,7 @@ object Nullables with
245245
&& refOwner.isTerm
246246
&& recur(curCtx.owner)
247247

248-
given treeOps: extension (tree: Tree) with
248+
extension treeOps on (tree: Tree) with
249249

250250
/* The `tree` with added nullability attachment */
251251
def withNotNullInfo(info: NotNullInfo): tree.type =
@@ -335,7 +335,7 @@ object Nullables with
335335
tree.computeNullable()
336336
}.traverse(tree)
337337

338-
given assignOps: extension (tree: Assign) with
338+
extension assignOps on (tree: Assign) with
339339
def computeAssignNullable()(given Context): tree.type = tree.lhs match
340340
case TrackedRef(ref) =>
341341
val rhstp = tree.rhs.typeOpt

0 commit comments

Comments
 (0)