From 63fa05cf443f9a39b2b2ace1a8b68fc6fe3add70 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 5 Dec 2013 11:57:34 +0100 Subject: Changing some assertions on isCommittable --- src/dotty/tools/dotc/ast/Trees.scala | 3 +-- src/dotty/tools/dotc/core/NameOps.scala | 4 +++- src/dotty/tools/dotc/core/TyperState.scala | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/dotty') diff --git a/src/dotty/tools/dotc/ast/Trees.scala b/src/dotty/tools/dotc/ast/Trees.scala index 43c96b587..c1039a996 100644 --- a/src/dotty/tools/dotc/ast/Trees.scala +++ b/src/dotty/tools/dotc/ast/Trees.scala @@ -235,8 +235,7 @@ object Trees { * type. (Overridden by empty trees) */ def withType(tpe: Type)(implicit ctx: Context): ThisTree[Type] = { - // temporary solution to catch unreported errors early - if (tpe == ErrorType) assert(ctx.errorsReported || !ctx.typerState.isCommittable) + if (tpe == ErrorType) assert(ctx.errorsReported) withTypeUnchecked(tpe) } diff --git a/src/dotty/tools/dotc/core/NameOps.scala b/src/dotty/tools/dotc/core/NameOps.scala index 6b365babb..c9665577d 100644 --- a/src/dotty/tools/dotc/core/NameOps.scala +++ b/src/dotty/tools/dotc/core/NameOps.scala @@ -197,8 +197,10 @@ object NameOps { val p = name.indexOfSlice(TRAIT_SETTER_SEPARATOR) if (p >= 0) (name drop (p + TRAIT_SETTER_SEPARATOR.length)).asTermName.setterToGetter - else + else { + assert(name endsWith SETTER_SUFFIX, name) name.take(name.length - SETTER_SUFFIX.length).asTermName + } } /** Nominally, name$default$N, encoded for */ diff --git a/src/dotty/tools/dotc/core/TyperState.scala b/src/dotty/tools/dotc/core/TyperState.scala index bac33e143..f46c58c90 100644 --- a/src/dotty/tools/dotc/core/TyperState.scala +++ b/src/dotty/tools/dotc/core/TyperState.scala @@ -64,7 +64,6 @@ extends TyperState(reporter) { override def commit()(implicit ctx: Context) = { val targetState = ctx.typerState assert(isCommittable) - assert(targetState.isCommittable) targetState.constraint = constraint val toCollect = new mutable.ListBuffer[PolyType] -- cgit v1.2.3