diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2010-05-20 14:05:17 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2010-05-20 14:05:17 +0000 |
commit | 293b70525e5d22e64af51d99aea6714b197aa052 (patch) | |
tree | c74f94771aaf4edda90ce8da227cdbb7d98984a8 | |
parent | 4debc5bf1e89a8cb185fd7af1adf1c81c0e95e0c (diff) | |
download | scala-293b70525e5d22e64af51d99aea6714b197aa052.tar.gz scala-293b70525e5d22e64af51d99aea6714b197aa052.tar.bz2 scala-293b70525e5d22e64af51d99aea6714b197aa052.zip |
Closed #3432.
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala | 4 | ||||
-rw-r--r-- | test/files/run/spec-ame.check | 2 | ||||
-rw-r--r-- | test/files/run/spec-ame.scala | 17 |
3 files changed, 23 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index b282f8fbd3..60634c467f 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -570,6 +570,10 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { normalizeMember(m.owner, m, outerEnv) flatMap { normalizedMember => val ms = specializeMember(m.owner, normalizedMember, outerEnv, clazz.info.typeParams) // atPhase(currentRun.typerPhase)(println("normalizedMember.info: " + normalizedMember.info)) // bring the info to the typer phase + // interface traits have concrete members now + if (ms.nonEmpty && clazz.isTrait && clazz.isInterface) + clazz.resetFlag(INTERFACE) + if (normalizedMember.isMethod) { val newTpe = subst(outerEnv, normalizedMember.info) if (newTpe != normalizedMember.info) // only do it when necessary, otherwise the method type might be at a later phase already diff --git a/test/files/run/spec-ame.check b/test/files/run/spec-ame.check new file mode 100644 index 0000000000..afa12db4df --- /dev/null +++ b/test/files/run/spec-ame.check @@ -0,0 +1,2 @@ +abc +10 diff --git a/test/files/run/spec-ame.scala b/test/files/run/spec-ame.scala new file mode 100644 index 0000000000..86c47077f0 --- /dev/null +++ b/test/files/run/spec-ame.scala @@ -0,0 +1,17 @@ +// ticket #3432 +object Test { + trait B[@specialized(Int) T] { + def value: T + } + + class A[@specialized(Int) T](x: T) { + def foo: B[T] = new B[T] { + def value = x + } + } + + def main(args: Array[String]) { + println((new A("abc")).foo.value) + println((new A(10)).foo.value) + } +} |