aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-06-29 20:20:40 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-11 13:35:05 +0200
commit31ecad5922c1a66d3ddd01163086eb0326299d35 (patch)
tree602392a718da0390343033a4a0bc6dd574bbf426
parentdc5be65541d17cb726b3a88ef052e65f13f0cb18 (diff)
downloaddotty-31ecad5922c1a66d3ddd01163086eb0326299d35.tar.gz
dotty-31ecad5922c1a66d3ddd01163086eb0326299d35.tar.bz2
dotty-31ecad5922c1a66d3ddd01163086eb0326299d35.zip
Drop assertion in TypeMap
The deleted assertion could fail for code that was erroneous. - Enable new hk scheme.
-rw-r--r--src/dotty/tools/dotc/config/Config.scala8
-rw-r--r--src/dotty/tools/dotc/core/Types.scala4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/config/Config.scala b/src/dotty/tools/dotc/config/Config.scala
index bf6f8493b..cd2b7ea4b 100644
--- a/src/dotty/tools/dotc/config/Config.scala
+++ b/src/dotty/tools/dotc/config/Config.scala
@@ -10,7 +10,7 @@ object Config {
final val checkCacheMembersNamed = false
- final val newHK = false
+ final val newHK = true
/** When updating a constraint bound, check that the constrained parameter
* does not appear at the top-level of either of its bounds.
@@ -80,9 +80,11 @@ object Config {
final val checkProjections = false
/** If this flag is set it is checked that &/| only apply to types
- * that are either both hk types or both * types.
+ * that are either both hk types or both * types. Should be used
+ * only for debugging as there a generic class without arguments
+ * can be produced in an And by Implicits.liftToClasses.
*/
- final val checkKinds = true
+ final val checkKinds = false
/** The recursion depth for showing a summarized string */
final val summarizeDepth = 2
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 387122522..c9d2b5029 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -2356,8 +2356,7 @@ object Types {
object OrType {
def apply(tp1: Type, tp2: Type)(implicit ctx: Context) = {
assertUnerased()
- if (Config.checkKinds)
- assert((tp1.knownHK - tp2.knownHK).abs <= 1, i"$tp1 | $tp2")
+ if (Config.checkKinds) assert((tp1.knownHK - tp2.knownHK).abs <= 1, i"$tp1 | $tp2")
unique(new CachedOrType(tp1, tp2))
}
def make(tp1: Type, tp2: Type)(implicit ctx: Context): Type =
@@ -3582,7 +3581,6 @@ object Types {
try this(arg)
finally variance = saved
}
- assert(tp.args.length == tp.typeParams.length, tp)
derivedAppliedType(tp, this(tp.tycon),
tp.args.zipWithConserve(tp.typeParams)(mapArg))