diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-08-10 21:32:51 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-08-11 14:26:27 +1000 |
commit | 2bde3928833ae194fc7e2094b8955112b70fd31f (patch) | |
tree | 5a3073459a8dcdb7349a47c032f0f8fa8266401d /test | |
parent | 4c8aab0abbd8aee05866aae9c866f3e3142c5b85 (diff) | |
download | scala-2bde3928833ae194fc7e2094b8955112b70fd31f.tar.gz scala-2bde3928833ae194fc7e2094b8955112b70fd31f.tar.bz2 scala-2bde3928833ae194fc7e2094b8955112b70fd31f.zip |
Don't generate specialized overrides in traits
The term "specialized override" is used to describe a method
in a synthetic specialized subclass that generically substitutes
the specialized type args into the siganture of a generic method.
For example, `trait T[@spec A] { def t(a: A) }` gives rise to
`def t(a: Int)` under the type environment `A=Int`.
This commit avoids doing this for specialized traits, only classes
have these overrides now. The motivation is to make it simpler to
use specialized interfaces (like `T$mcI$sp` from the example above)
as Java functional interfaces.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/trait-default-specialize.check | 1 | ||||
-rw-r--r-- | test/files/run/trait-default-specialize.scala | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/test/files/run/trait-default-specialize.check b/test/files/run/trait-default-specialize.check index aedd8c9538..1034d1c703 100644 --- a/test/files/run/trait-default-specialize.check +++ b/test/files/run/trait-default-specialize.check @@ -1,4 +1,3 @@ -public abstract void T$mcI$sp.t(int) public abstract void T.t(java.lang.Object) 0 0 diff --git a/test/files/run/trait-default-specialize.scala b/test/files/run/trait-default-specialize.scala index 7b57ddc1eb..6faa9d5f47 100644 --- a/test/files/run/trait-default-specialize.scala +++ b/test/files/run/trait-default-specialize.scala @@ -1,4 +1,4 @@ -trait T[@specialized A] { +trait T[@specialized(Int) A] { def t(a: A): Unit } |