Skip to content

Commit ce42e92

Browse files
committed
More modifier lock down in Type{Comparers, Ops}
1 parent 93d736b commit ce42e92

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/dotty/tools/dotc/core/TypeComparers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ object TypeComparers {
1111
private final val LogPendingSubTypesThreshold = 50
1212
}
1313

14-
class TypeComparer(_ctx: Context) extends DotClass {
14+
final class TypeComparer(_ctx: Context) extends DotClass {
1515
import TypeComparer._
1616

1717
implicit val ctx = _ctx

src/dotty/tools/dotc/core/TypeOps.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ trait TypeOps { this: Context =>
5555
}
5656
}
5757

58-
class AsSeenFromMap(pre: Type, clazz: Symbol) extends TypeMap {
58+
final class AsSeenFromMap(pre: Type, clazz: Symbol) extends TypeMap {
5959
def apply(tp: Type) = asSeenFrom(tp, pre, clazz, this)
6060
}
6161

@@ -133,7 +133,7 @@ trait TypeOps { this: Context =>
133133
final def glb(tps: List[Type]): Type =
134134
(defn.AnyType /: tps)(glb)
135135

136-
def lub(tp1: Type, tp2: Type): Type =
136+
final def lub(tp1: Type, tp2: Type): Type =
137137
if (tp1 eq tp2) tp1
138138
else if (tp1.isWrong) tp1
139139
else if (tp2.isWrong) tp2
@@ -194,7 +194,7 @@ trait TypeOps { this: Context =>
194194
* to a list of typerefs, by converting all refinements to member
195195
* definitions in scope `decls`.
196196
*/
197-
def normalizeToRefs(parents: List[Type], cls: ClassSymbol, decls: Scope): List[TypeRef] = {
197+
final def normalizeToRefs(parents: List[Type], cls: ClassSymbol, decls: Scope): List[TypeRef] = {
198198
var refinements = Map[TypeName, Type]()
199199
var formals = Map[TypeName, Symbol]()
200200
def normalizeToRef(tp: Type): TypeRef = tp match {

0 commit comments

Comments
 (0)