Skip to content

Commit 2f9b8dd

Browse files
committed
Switch TypeApplications to inherited extensions
1 parent c142bec commit 2f9b8dd

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ object TypeApplications:
150150

151151
/** Extensions that model type application.
152152
*/
153-
trait TypeApplications:
153+
class TypeApplications:
154154
import TypeApplications.*
155155

156-
extension (self: Type) { // braces to avoid indent
156+
extension (self: Type) { // braces to avoid indenting existing code
157157
/** The type parameters of this type are:
158158
* For a ClassInfo type, the type parameters of its class.
159159
* For a typeref referring to a class, the type parameters of the class.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Names.Name
1111
import StdNames.nme
1212
import config.Feature
1313

14-
class TypeUtils:
14+
class TypeUtils extends TypeApplications:
1515
/** A decorator that provides methods on types
1616
* that are needed in the transformer pipeline.
1717
*/

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,11 +2134,7 @@ object Types extends TypeUtils {
21342134
/** Is the `hash` of this type the same for all possible sequences of enclosing binders? */
21352135
def hashIsStable: Boolean = true
21362136
}
2137-
object Type:
2138-
// Extensions that model type application.
2139-
given TypeApplications()
2140-
2141-
// end Type
2137+
end Type
21422138

21432139
// ----- Type categories ----------------------------------------------
21442140

compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1897,9 +1897,9 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler
18971897
dotc.core.Symbols.defn.isTupleNType(self)
18981898
def select(sym: Symbol): TypeRepr = self.select(sym)
18991899
def appliedTo(targ: TypeRepr): TypeRepr =
1900-
Types.Type.given_TypeApplications.appliedTo(self)(targ)
1900+
Types.appliedTo(self)(targ)
19011901
def appliedTo(targs: List[TypeRepr]): TypeRepr =
1902-
Types.Type.given_TypeApplications.appliedTo(self)(targs)
1902+
Types.appliedTo(self)(targs)
19031903
def substituteTypes(from: List[Symbol], to: List[TypeRepr]): TypeRepr =
19041904
self.subst(from, to)
19051905

0 commit comments

Comments
 (0)