Skip to content

Commit cb11f98

Browse files
committed
Add paragraph about generic signatures
1 parent 1a6b622 commit cb11f98

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/blog/_posts/2017-11-21-fifth-dotty-milestone-release.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,23 @@ Currently two backends that use this frontend are available
3737

3838
Known issues: #3490, #3500.
3939

40+
### Generic java signatures
41+
Dotty now emits generic signatures for classes and methods. These generic signatures represent the
42+
signatures before type parameters have been erased. They are used by compilers, debuggers and to
43+
support reflection.
44+
45+
For instance, it means that the following code now behaves as expected when compiled with Dotty:
46+
```scala
47+
class Foo[T, U]
48+
object Test {
49+
def main(args: Array[String]): Unit = {
50+
val typeParams = classOf[Foo[_, _]].getTypeParameters
51+
println(typeParams.map(_.getName).mkString(", ")) // prints 'T, U'
52+
}
53+
}
54+
```
55+
56+
Known issues: #3476
4057

4158
## Trying out Dotty
4259
### Scastie

0 commit comments

Comments
 (0)