Skip to content

Commit 7adc6c8

Browse files
committed
Drop assertion in TypeMap
The deleted assertion could fail for code that was erroneous. - Enable new hk scheme.
1 parent 0d434f9 commit 7adc6c8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/dotty/tools/dotc/config/Config.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ object Config {
1010

1111
final val checkCacheMembersNamed = false
1212

13-
final val newHK = false
13+
final val newHK = true
1414

1515
/** When updating a constraint bound, check that the constrained parameter
1616
* does not appear at the top-level of either of its bounds.
@@ -80,9 +80,11 @@ object Config {
8080
final val checkProjections = false
8181

8282
/** If this flag is set it is checked that &/| only apply to types
83-
* that are either both hk types or both * types.
83+
* that are either both hk types or both * types. Should be used
84+
* only for debugging as there a generic class without arguments
85+
* can be produced in an And by Implicits.liftToClasses.
8486
*/
85-
final val checkKinds = true
87+
final val checkKinds = false
8688

8789
/** The recursion depth for showing a summarized string */
8890
final val summarizeDepth = 2

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,8 +2356,7 @@ object Types {
23562356
object OrType {
23572357
def apply(tp1: Type, tp2: Type)(implicit ctx: Context) = {
23582358
assertUnerased()
2359-
if (Config.checkKinds)
2360-
assert((tp1.knownHK - tp2.knownHK).abs <= 1, i"$tp1 | $tp2")
2359+
if (Config.checkKinds) assert((tp1.knownHK - tp2.knownHK).abs <= 1, i"$tp1 | $tp2")
23612360
unique(new CachedOrType(tp1, tp2))
23622361
}
23632362
def make(tp1: Type, tp2: Type)(implicit ctx: Context): Type =
@@ -3582,7 +3581,6 @@ object Types {
35823581
try this(arg)
35833582
finally variance = saved
35843583
}
3585-
assert(tp.args.length == tp.typeParams.length, tp)
35863584
derivedAppliedType(tp, this(tp.tycon),
35873585
tp.args.zipWithConserve(tp.typeParams)(mapArg))
35883586

0 commit comments

Comments
 (0)