summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Macros.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-14 15:23:51 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-09-15 00:55:27 +0200
commit210f8c8f108aaf650a5be640c4db0d2336193f33 (patch)
tree6939dd3043ff7dd2af840e9d8a66b2e612c6d78d /src/compiler/scala/tools/nsc/typechecker/Macros.scala
parented913c2963c472440b06a3a4cfa3d2853cea21d4 (diff)
downloadscala-210f8c8f108aaf650a5be640c4db0d2336193f33.tar.gz
scala-210f8c8f108aaf650a5be640c4db0d2336193f33.tar.bz2
scala-210f8c8f108aaf650a5be640c4db0d2336193f33.zip
SI-6372 cleans up the API of Attachments
Previously Attachments allowed multiple attachments that correspond to the same attachment type. This created a potential for confusion, given that Attachments.get only searched for the first attachment of a given type. Hence I made Attachments.add overwrite previously existing attachments of a given type and renamed it to Attachments.update, so that the name suits the intention better.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Macros.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Macros.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Macros.scala b/src/compiler/scala/tools/nsc/typechecker/Macros.scala
index 7e9b288853..7796c0bf1b 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Macros.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Macros.scala
@@ -713,7 +713,7 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces {
if (isNullaryInvocation(expandee)) expectedTpe = expectedTpe.finalResultType
var typechecked = typecheck("macro def return type", expanded, expectedTpe)
typechecked = typecheck("expected type", typechecked, pt)
- typechecked addAttachment MacroExpansionAttachment(expandee)
+ typechecked updateAttachment MacroExpansionAttachment(expandee)
} finally {
popMacroContext()
}
@@ -762,7 +762,7 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces {
case (false, true) =>
macroLogLite("macro expansion is delayed: %s".format(expandee))
delayed += expandee -> undetparams
- expandee addAttachment MacroRuntimeAttachment(delayed = true, typerContext = typer.context, macroContext = Some(macroArgs(typer, expandee).c))
+ expandee updateAttachment MacroRuntimeAttachment(delayed = true, typerContext = typer.context, macroContext = Some(macroArgs(typer, expandee).c))
Delay(expandee)
case (false, false) =>
import typer.TyperErrorGen._