aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/PostTyper.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-04-22 13:34:35 +0200
committerMartin Odersky <odersky@gmail.com>2015-04-22 17:19:35 +0200
commit3a158c0a047d2842c0604faf75251c0828408bc9 (patch)
treede0a4aef01c6722f9ed648d686c1b27fafd57ecb /src/dotty/tools/dotc/transform/PostTyper.scala
parent7e60221120015be2607947f2de55ca4984db7077 (diff)
downloaddotty-3a158c0a047d2842c0604faf75251c0828408bc9.tar.gz
dotty-3a158c0a047d2842c0604faf75251c0828408bc9.tar.bz2
dotty-3a158c0a047d2842c0604faf75251c0828408bc9.zip
Roll SyntheticMethods into PostTyper
Diffstat (limited to 'src/dotty/tools/dotc/transform/PostTyper.scala')
-rw-r--r--src/dotty/tools/dotc/transform/PostTyper.scala14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/transform/PostTyper.scala b/src/dotty/tools/dotc/transform/PostTyper.scala
index 98c110e11..1b42a2501 100644
--- a/src/dotty/tools/dotc/transform/PostTyper.scala
+++ b/src/dotty/tools/dotc/transform/PostTyper.scala
@@ -23,7 +23,9 @@ import Symbols._, TypeUtils._
* field (corresponding = super class field is initialized with subclass field)
* (@see ForwardParamAccessors)
*
- * (3) Check that `New` nodes can be instantiated, and that annotations are valid
+ * (3) Add synthetic methods (@see SyntheticMethods)
+ *
+ * (4) Check that `New` nodes can be instantiated, and that annotations are valid
*
* The reason for making this a macro transform is that some functions (in particular
* super and protected accessors and instantiation checks) are naturally top-down and
@@ -46,7 +48,8 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisTran
val superAcc = new SuperAccessors(thisTransformer)
val paramFwd = new ParamForwarding(thisTransformer)
-
+ val synthMth = new SyntheticMethods(thisTransformer)
+
/** Check that `tp` refers to a nonAbstract class
* and that the instance conforms to the self type of the created class.
*/
@@ -99,9 +102,10 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisTran
val saved = parentNews
parentNews ++= impl.parents.flatMap(newPart)
try
- paramFwd.forwardParamAccessors(
- superAcc.wrapTemplate(impl)(
- super.transform(_).asInstanceOf[Template]))
+ synthMth.addSyntheticMethods(
+ paramFwd.forwardParamAccessors(
+ superAcc.wrapTemplate(impl)(
+ super.transform(_).asInstanceOf[Template])))
finally parentNews = saved
case tree @ TypeApply(sel: Select, args) =>
val args1 = transform(args)