File tree 5 files changed +58
-2
lines changed
src/compiler/scala/tools/nsc/transform 5 files changed +58
-2
lines changed Original file line number Diff line number Diff line change @@ -763,11 +763,11 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
763
763
// was: new Forward(specMember) {
764
764
// override def target = m.owner.info.member(specializedName(m, env))
765
765
// }
766
- } else if (! sClass.isTrait && m.isMethod && ! m.hasAccessorFlag) { // other concrete methods
766
+ } else if (! ( sClass.isTrait && m.isDeferred) && m.isMethod && ! m.hasAccessorFlag) { // other concrete methods
767
767
// log("other concrete " + m)
768
768
forwardToOverload(m)
769
769
770
- } else if (! sClass.isTrait && m.isMethod && m.hasFlag(LAZY )) {
770
+ } else if (! ( sClass.isTrait && m.isDeferred) && m.isMethod && m.hasFlag(LAZY )) {
771
771
forwardToOverload(m)
772
772
773
773
} else if (m.isValue && ! m.isMethod) { // concrete value definition
Original file line number Diff line number Diff line change
1
+ put$mcJ$sp
2
+ fillRange$mcJ$sp
3
+ fillRange$mcJ$sp$
4
+ fillRange$mcJ$sp
Original file line number Diff line number Diff line change
1
+ trait Column {}
2
+
3
+ trait TypedColumn [@ specialized(Long , Double ) T ] extends Column {
4
+ def put (idx : Int , value : T ): Unit
5
+
6
+ def fillRange (start : Int , len : Int , value : T ): Unit = {
7
+ var idx = start
8
+ val end = start + len
9
+ while (idx < end) {
10
+ put(idx, value)
11
+ idx += 1
12
+ }
13
+ }
14
+ }
15
+
16
+ final class LongColumn extends TypedColumn [Long ] {
17
+ override def put (idx : Int , value : Long ): Unit = {
18
+ val frames = Thread .currentThread().getStackTrace.toList.drop(1 ).takeWhile(_.getMethodName != " main" )
19
+ println(frames.map(_.getMethodName).mkString(" \n " ))
20
+ }
21
+ }
22
+
23
+ object Test {
24
+ def main (args : Array [String ]): Unit = {
25
+ val c = new LongColumn
26
+ c.fillRange(0 , 1 , 10L )
27
+ }
28
+ }
Original file line number Diff line number Diff line change
1
+ g$mcI$sp
2
+ g$mcI$sp$
3
+ g$mcI$sp
4
+ f$mcI$sp
Original file line number Diff line number Diff line change
1
+ trait A [@ specialized(Int ) T ] {
2
+ def f (x : T ): Unit
3
+ }
4
+
5
+ trait B [@ specialized(Int ) T ] {
6
+ def g (x : T ): Unit = {
7
+ val frames = Thread .currentThread().getStackTrace.toList.drop(1 ).takeWhile(_.getMethodName != " main" )
8
+ println(frames.map(_.getMethodName).mkString(" \n " ))
9
+ }
10
+ }
11
+
12
+ class C [@ specialized(Int ) T ] extends A [T ] with B [T ] {
13
+ def f (x : T ): Unit = g(x)
14
+ }
15
+
16
+ object Test {
17
+ def main (args : Array [String ]): Unit = {
18
+ new C [Int ].f(0 )
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments