@@ -17,7 +17,6 @@ import Decorators._
17
17
import Denotations ._
18
18
import Periods ._
19
19
import Designators ._
20
- import util .Positions .{Position , NoPosition }
21
20
import util .Stats ._
22
21
import util .DotClass
23
22
import reporting .diagnostic .Message
@@ -26,16 +25,14 @@ import ast.tpd._
26
25
import ast .TreeTypeMap
27
26
import printing .Texts ._
28
27
import ast .untpd
29
- import dotty .tools .dotc .transform .Erasure
30
28
import printing .Printer
31
29
import Hashable ._
32
30
import Uniques ._
33
- import collection .{mutable , Seq , breakOut }
31
+ import collection .{mutable , Seq }
34
32
import config .Config
35
33
import annotation .tailrec
36
34
import Flags .FlagSet
37
35
import language .implicitConversions
38
- import scala .util .hashing .{ MurmurHash3 => hashing }
39
36
import config .Printers .{core , typr , cyclicErrors }
40
37
import java .lang .ref .WeakReference
41
38
@@ -936,7 +933,7 @@ object Types {
936
933
}
937
934
938
935
/** If this type contains embedded union types, replace them by their joins.
939
- * "Embedded" means: inside intersectons or recursive types, or in prefixes of refined types.
936
+ * "Embedded" means: inside intersections or recursive types, or in prefixes of refined types.
940
937
* If an embedded union is found, we first try to simplify or eliminate it by
941
938
* re-lubbing it while allowing type parameters to be constrained further.
942
939
* Any remaining union types are replaced by their joins.
@@ -3295,7 +3292,7 @@ object Types {
3295
3292
* @param creatorState The typer state in which the variable was created.
3296
3293
* @param bindingTree The TypeTree which introduces the type variable, or EmptyTree
3297
3294
* if the type variable does not correspond to a source term.
3298
- * @paran owner The current owner if the context where the variable was created.
3295
+ * @param owner The current owner if the context where the variable was created.
3299
3296
*
3300
3297
* `owningTree` and `owner` are used to determine whether a type-variable can be instantiated
3301
3298
* at some given point. See `Inferencing#interpolateUndetVars`.
@@ -3332,7 +3329,7 @@ object Types {
3332
3329
private def instantiateWith (tp : Type )(implicit ctx : Context ): Type = {
3333
3330
assert(tp ne this , s " self instantiation of ${tp.show}, constraint = ${ctx.typerState.constraint.show}" )
3334
3331
typr.println(s " instantiating ${this .show} with ${tp.show}" )
3335
- if ((ctx.typerState eq owningState.get) && ! ctx.typeComparer.subtypeCheckInProgress)
3332
+ if (owningState != null && (ctx.typerState eq owningState.get) && ! ctx.typeComparer.subtypeCheckInProgress)
3336
3333
inst = tp
3337
3334
ctx.typerState.constraint = ctx.typerState.constraint.replace(origin, tp)
3338
3335
tp
0 commit comments