summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Namers.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2012-08-16 10:22:25 +0200
committerLukas Rytz <lukas.rytz@epfl.ch>2012-08-16 14:24:14 +0200
commitffa9b1afc9168e699cfa568a94f84e40b5cc62b7 (patch)
tree389408cc60c0eacee6059b0e4178ccdd61ce1e12 /src/compiler/scala/tools/nsc/typechecker/Namers.scala
parent3ccaa1026e7e74d99fe39c9608e28c48b422e2c9 (diff)
parente05122cdb38c5c6bd4900247f371fa23b46f9c22 (diff)
downloadscala-ffa9b1afc9168e699cfa568a94f84e40b5cc62b7.tar.gz
scala-ffa9b1afc9168e699cfa568a94f84e40b5cc62b7.tar.bz2
scala-ffa9b1afc9168e699cfa568a94f84e40b5cc62b7.zip
Merge remote-tracking branch 'upstream/2.10.x' into merge-210
Required a few changes of `HIDDEN` -> `ARTIFACT` and `isHidden` -> `isArtifact` Conflicts: src/reflect/scala/reflect/internal/Flags.scala
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index b817ec7b5e..fc9cb02d37 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -556,7 +556,7 @@ trait Namers extends MethodSynthesis {
// via "x$lzy" as can be seen in test #3927.
val sym = (
if (owner.isClass) createFieldSymbol(tree)
- else owner.newValue(tree.name append nme.LAZY_LOCAL, tree.pos, (tree.mods.flags | HIDDEN) & ~IMPLICIT)
+ else owner.newValue(tree.name append nme.LAZY_LOCAL, tree.pos, (tree.mods.flags | ARTIFACT) & ~IMPLICIT)
)
enterValSymbol(tree, sym setFlag MUTABLE setLazyAccessor lazyAccessor)
}
@@ -577,7 +577,7 @@ trait Namers extends MethodSynthesis {
case DefDef(_, nme.CONSTRUCTOR, _, _, _, _) =>
assignAndEnterFinishedSymbol(tree)
case DefDef(mods, name, tparams, _, _, _) =>
- val bridgeFlag = if (mods hasAnnotationNamed tpnme.bridgeAnnot) BRIDGE | HIDDEN else 0
+ val bridgeFlag = if (mods hasAnnotationNamed tpnme.bridgeAnnot) BRIDGE | ARTIFACT else 0
val sym = assignAndEnterSymbol(tree) setFlag bridgeFlag
if (name == nme.copy && sym.isSynthetic)
@@ -988,6 +988,15 @@ trait Namers extends MethodSynthesis {
// (either "macro ???" as they used to or just "???" to maximally simplify their compilation)
if (fastTrack contains ddef.symbol) ddef.symbol setFlag MACRO
+ // macro defs need to be typechecked in advance
+ // because @macroImpl annotation only gets assigned during typechecking
+ // otherwise macro defs wouldn't be able to robustly coexist with their clients
+ // because a client could be typechecked before a macro def that it uses
+ if (ddef.symbol.isTermMacro) {
+ val pt = resultPt.substSym(tparamSyms, tparams map (_.symbol))
+ typer.computeMacroDefType(ddef, pt)
+ }
+
thisMethodType({
val rt = (
if (!tpt.isEmpty) {