summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-01-30 12:13:16 -0800
committerPaul Phillips <paulp@improving.org>2012-01-30 12:21:27 -0800
commitcb952efd2955eb1bf80ae7fb9f6fe2efc465b45f (patch)
treed8c1c3f67d6f4f2b80129e4add031847f740bcb3 /src/compiler
parent66cf4e9a920506d5531279e2e7a6cbae28372828 (diff)
downloadscala-cb952efd2955eb1bf80ae7fb9f6fe2efc465b45f.tar.gz
scala-cb952efd2955eb1bf80ae7fb9f6fe2efc465b45f.tar.bz2
scala-cb952efd2955eb1bf80ae7fb9f6fe2efc465b45f.zip
Synthesize getClass method for AnyVal children.
The synthetic method is only a null for now.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
index 4ea21b1c44..3ee5bf601d 100644
--- a/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
@@ -47,6 +47,17 @@ trait SyntheticMethods extends ast.TreeDSL {
newTyper( if (reporter.hasErrors) context makeSilent false else context )
)
import synthesizer._
+
+ if (clazz0 isSubClass AnyValClass) return {
+ if (clazz0.info member nme.getClass_ isDeferred) {
+ val getClassMethod = createMethod(nme.getClass_, getClassReturnType(clazz.tpe)) { sym =>
+ // XXX dummy implementation for now
+ NULL
+ }
+ treeCopy.Template(templ, templ.parents, templ.self, templ.body :+ getClassMethod)
+ }
+ else templ
+ }
val originalAccessors = clazz.caseFieldAccessors
// private ones will have been renamed -- make sure they are entered