diff options
author | odersky <odersky@gmail.com> | 2016-05-23 16:08:59 +0200 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2016-05-23 16:08:59 +0200 |
commit | cec6467c7a430395e19d24d2700bda72ffab5d36 (patch) | |
tree | 7ba46bad057d5bd16f23ba053d87b77c1e71cf31 | |
parent | 3e3df656a53ae66434bea94ae7c3a834369e2c39 (diff) | |
parent | a5ae15e2943bd5319c86c1fc01753fc2ceeb36d6 (diff) | |
download | dotty-cec6467c7a430395e19d24d2700bda72ffab5d36.tar.gz dotty-cec6467c7a430395e19d24d2700bda72ffab5d36.tar.bz2 dotty-cec6467c7a430395e19d24d2700bda72ffab5d36.zip |
Merge pull request #1249 from dotty-staging/change-early-annots
Evaluate annotations before completing tree of definitions
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 5 | ||||
-rw-r--r-- | src/strawman/collections/CollectionStrawMan4.scala | 2 | ||||
-rw-r--r-- | src/strawman/collections/CollectionStrawMan5.scala | 9 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 82b3b56e9..a540b6ea5 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -562,8 +562,8 @@ class Namer { typer: Typer => * to pick up the context at the point where the completer was created. */ def completeInCreationContext(denot: SymDenotation): Unit = { - denot.info = typeSig(denot.symbol) addAnnotations(denot) + denot.info = typeSig(denot.symbol) Checking.checkWellFormed(denot.symbol) } } @@ -670,6 +670,8 @@ class Namer { typer: Typer => ok } + addAnnotations(denot) + val selfInfo = if (self.isEmpty) NoType else if (cls.is(Module)) { @@ -699,7 +701,6 @@ class Namer { typer: Typer => index(rest)(inClassContext(selfInfo)) denot.info = ClassInfo(cls.owner.thisType, cls, parentRefs, decls, selfInfo) - addAnnotations(denot) Checking.checkWellFormed(cls) if (isDerivedValueClass(cls)) cls.setFlag(Final) cls.setApplicableFlags( diff --git a/src/strawman/collections/CollectionStrawMan4.scala b/src/strawman/collections/CollectionStrawMan4.scala index 874f67a2d..ec20849ff 100644 --- a/src/strawman/collections/CollectionStrawMan4.scala +++ b/src/strawman/collections/CollectionStrawMan4.scala @@ -12,6 +12,8 @@ import annotation.tailrec * strengths and weaknesses of different collection architectures. * * For a test file, see tests/run/CollectionTests.scala. + * + * Strawman4 is like strawman1, but built over views instead of by-name iterators */ object CollectionStrawMan4 { diff --git a/src/strawman/collections/CollectionStrawMan5.scala b/src/strawman/collections/CollectionStrawMan5.scala index 1a89d9659..5d04c2c98 100644 --- a/src/strawman/collections/CollectionStrawMan5.scala +++ b/src/strawman/collections/CollectionStrawMan5.scala @@ -12,6 +12,15 @@ import annotation.tailrec * strengths and weaknesses of different collection architectures. * * For a test file, see tests/run/CollectionTests.scala. + * + * Strawman5 is like strawman4, but using inheritance through ...Like traits + * instead of decorators. + * + * Advantage: Much easier to specialize. See partition for strict (buildable) collections + * or drop for Lists. + * + * Disadvantage: More "weird" types in base traits; some awkwardness with + * @uncheckedVariance. */ object CollectionStrawMan5 { |