diff options
author | Martin Odersky <odersky@gmail.com> | 2017-04-02 19:11:34 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-04-11 09:33:12 +0200 |
commit | d0efabf2817468c248db8a2a6d5a6c0b58747867 (patch) | |
tree | 7f9c04d5631f1a204a8b343de1623cd2c57848e7 /compiler/src/dotty/tools/dotc/transform/TreeChecker.scala | |
parent | 264211f6b7129923c01c2e3c402b157685d64b1f (diff) | |
download | dotty-d0efabf2817468c248db8a2a6d5a6c0b58747867.tar.gz dotty-d0efabf2817468c248db8a2a6d5a6c0b58747867.tar.bz2 dotty-d0efabf2817468c248db8a2a6d5a6c0b58747867.zip |
Lazy entering of names with internal $'s in package scopes
Names with internal $'s are entered in package scopes only if
- we look for a name with internal $'s.
- we want to know all the members of a package scope
This optimization seems to be fairly effective. The typical range
of package scopes that need $-names is between 0 and 20%. The optimization
seems to improve execution time of all unit tests by about 3%.
Also. drop the inheritance from Iterable to Scope. The reason
is that we now need a context parameter for toList and
other Iterable operations which makes them impossible to
fit into the Iterable framework.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform/TreeChecker.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/transform/TreeChecker.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala index 44c26ecd9..eb7773ef3 100644 --- a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala +++ b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala @@ -391,11 +391,11 @@ class TreeChecker extends Phase with SymTransformer { !x.isCompanionMethod && !x.isValueClassConvertMethod - val symbolsNotDefined = cls.classInfo.decls.toSet.filter(isNonMagicalMethod) -- impl.body.map(_.symbol) - constr.symbol + val symbolsNotDefined = cls.classInfo.decls.toList.toSet.filter(isNonMagicalMethod) -- impl.body.map(_.symbol) - constr.symbol assert(symbolsNotDefined.isEmpty, i" $cls tree does not define methods: ${symbolsNotDefined.toList}%, %\n" + - i"expected: ${cls.classInfo.decls.toSet.filter(isNonMagicalMethod).toList}%, %\n" + + i"expected: ${cls.classInfo.decls.toList.toSet.filter(isNonMagicalMethod)}%, %\n" + i"defined: ${impl.body.map(_.symbol)}%, %") super.typedClassDef(cdef, cls) |