diff options
author | Paul Phillips <paulp@improving.org> | 2011-12-23 03:52:03 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-12-30 23:41:52 -0800 |
commit | 82c793a438c7bd802daf96c8b2012f54fbd737ba (patch) | |
tree | 3bed6b8cc121a17e54529f312edcf6c2058453c4 /src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | |
parent | 6150b589993fc58817d6d1d2e4326c8ff135a0ea (diff) | |
download | scala-82c793a438c7bd802daf96c8b2012f54fbd737ba.tar.gz scala-82c793a438c7bd802daf96c8b2012f54fbd737ba.tar.bz2 scala-82c793a438c7bd802daf96c8b2012f54fbd737ba.zip |
More performance work.
Custom versions of collections which methods which operate on 2 or 3
collections. Eliminated most users of zip/zipped. Cleaned up the kinds
checking code somewhat. Reduced the number of silent typechecks
being performed at named argument sites.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/RefChecks.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/RefChecks.scala | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala index 59a1a254c6..ace38bb4cb 100644 --- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala +++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala @@ -410,8 +410,6 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R } } - - def checkOverrideTypes() { if (other.isAliasType) { //if (!member.typeParams.isEmpty) (1.5) @MAT @@ -420,14 +418,14 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R // overrideError("may not override parameterized type"); // @M: substSym - if( !(sameLength(member.typeParams, other.typeParams) && (self.memberType(member).substSym(member.typeParams, other.typeParams) =:= self.memberType(other))) ) // (1.6) + if( !(sameLength(member.typeParams, other.typeParams) && (memberTp.substSym(member.typeParams, other.typeParams) =:= otherTp)) ) // (1.6) overrideTypeError(); - } else if (other.isAbstractType) { + } + else if (other.isAbstractType) { //if (!member.typeParams.isEmpty) // (1.7) @MAT // overrideError("may not be parameterized"); - - val memberTp = self.memberType(member) val otherTp = self.memberInfo(other) + if (!(otherTp.bounds containsType memberTp)) { // (1.7.1) overrideTypeError(); // todo: do an explaintypes with bounds here explainTypes(_.bounds containsType _, otherTp, memberTp) |