diff options
author | Martin Odersky <odersky@gmail.com> | 2014-04-18 11:31:11 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-05-08 21:47:59 +0200 |
commit | 92c02ee9d514c197221fd4c4a027fe0e70e081f2 (patch) | |
tree | f67fca6c3ee91658257b960e3e4a39c1bb50d4c3 /test | |
parent | 5c11da2148412f36416ad6998909138323ae4894 (diff) | |
download | dotty-92c02ee9d514c197221fd4c4a027fe0e70e081f2.tar.gz dotty-92c02ee9d514c197221fd4c4a027fe0e70e081f2.tar.bz2 dotty-92c02ee9d514c197221fd4c4a027fe0e70e081f2.zip |
Removing duplication between Any and Object methods
We cannot have same named methods defined in Object and Any because after erasure
the Any references get remapped to the Object methods which would result in a double binding
assertion failure.
Instead we do the following:
- Have some methods exist only in Any, and remap them with the Erasure denotation
transformer to be owned by Object.
- Have other methods exist only in Object.
To achieve this, we synthesize all Any and Object methods; Objetc methods no longer get
loaded from a classfile.
There's a complication with getClass. We need to reconsider what the best treatment of getClass is.
Right now there's too much magic going on for my taste. It might be better to leave getClass on Object only as it
is in Java, forget about the special treatement of its type, and have another getClass like method in
an decorator on class Any. That could produce the right types and could also work for primitive types.
Diffstat (limited to 'test')
-rw-r--r-- | test/dotc/tests.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/dotc/tests.scala b/test/dotc/tests.scala index c6fbcabf4..3f99a9d5b 100644 --- a/test/dotc/tests.scala +++ b/test/dotc/tests.scala @@ -12,7 +12,7 @@ class tests extends CompilerTest { // "-Xprompt", // "-explaintypes", // "-Yshow-suppressed-errors", - "-pagewidth", "160" + "-pagewidth", "160"//, "-Ystop-before:terminal" ) val twice = List("#runs", "2", "-YnoDoubleBindings") val doErase = List("-Ystop-before:terminal") |