Skip to content

Evaluate annotations before completing tree of definitions #1249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/dotty/tools/dotc/typer/Namer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -670,6 +670,8 @@ class Namer { typer: Typer =>
ok
}

addAnnotations(denot)

val selfInfo =
if (self.isEmpty) NoType
else if (cls.is(Module)) {
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 2 additions & 0 deletions src/strawman/collections/CollectionStrawMan4.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this commit here intentionally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I just threw it in to save time.

*/
object CollectionStrawMan4 {

Expand Down
9 changes: 9 additions & 0 deletions src/strawman/collections/CollectionStrawMan5.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down