diff options
author | Martin Odersky <odersky@gmail.com> | 2016-09-01 15:59:52 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:07:40 +0200 |
commit | d63a6ba8540fb8ea7d01350ea68ff1ef0b53c5d4 (patch) | |
tree | 7d6abd4813a7254f6f735f4f95ffd5a20977a66b /src/dotty/tools/dotc/typer | |
parent | c87a9dd1f34cd7afe3fba0edfa1463019eaa78bd (diff) | |
download | dotty-d63a6ba8540fb8ea7d01350ea68ff1ef0b53c5d4.tar.gz dotty-d63a6ba8540fb8ea7d01350ea68ff1ef0b53c5d4.tar.bz2 dotty-d63a6ba8540fb8ea7d01350ea68ff1ef0b53c5d4.zip |
Make Context#moreProperties strongly typed
To do this, factor out Key from Attachment into a new type, Property.Key.
Diffstat (limited to 'src/dotty/tools/dotc/typer')
-rw-r--r-- | src/dotty/tools/dotc/typer/Inliner.scala | 4 | ||||
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/typer/Inliner.scala b/src/dotty/tools/dotc/typer/Inliner.scala index 852689a75..4eb8588a6 100644 --- a/src/dotty/tools/dotc/typer/Inliner.scala +++ b/src/dotty/tools/dotc/typer/Inliner.scala @@ -18,7 +18,7 @@ import Annotations.Annotation import transform.ExplicitOuter import config.Printers.inlining import ErrorReporting.errorTree -import util.Attachment +import util.Property import collection.mutable object Inliner { @@ -28,7 +28,7 @@ object Inliner { lazy val body = tree } - private val InlinedBody = new Attachment.Key[InlinedBody] + private val InlinedBody = new Property.Key[InlinedBody] // to be used as attachment def attachBody(inlineAnnot: Annotation, tree: => Tree)(implicit ctx: Context): Unit = inlineAnnot.tree.putAttachment(InlinedBody, new InlinedBody(tree)) diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 06e798bdb..4dff02018 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -9,7 +9,7 @@ import Contexts._, Symbols._, Types._, SymDenotations._, Names._, NameOps._, Fla import ast.desugar, ast.desugar._ import ProtoTypes._ import util.Positions._ -import util.{Attachment, SourcePosition, DotClass} +import util.{Property, SourcePosition, DotClass} import collection.mutable import annotation.tailrec import ErrorReporting._ @@ -160,9 +160,9 @@ class Namer { typer: Typer => import untpd._ - val TypedAhead = new Attachment.Key[tpd.Tree] - val ExpandedTree = new Attachment.Key[Tree] - val SymOfTree = new Attachment.Key[Symbol] + val TypedAhead = new Property.Key[tpd.Tree] + val ExpandedTree = new Property.Key[Tree] + val SymOfTree = new Property.Key[Symbol] /** A partial map from unexpanded member and pattern defs and to their expansions. * Populated during enterSyms, emptied during typer. |