forked from scala/scala
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The constraint type of the type parameter supports specialization, and there are `specialized` annotation. It should support specialization. scala/bug#11489
- Loading branch information
1 parent
98972e5
commit 959ca84
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class Parent { | ||
def twice[@scala.specialized(Int) I <: Int : ValueOf]: Int = valueOf[I] * 2 | ||
} | ||
|
||
object Test extends App { | ||
val actualMethods = (new Parent).getClass.getDeclaredMethods | ||
assert(actualMethods.count(_.getName == "twice$mIc$sp") == 1) | ||
} |