@@ -38,8 +38,6 @@ This is our 16th scheduled release according to our
38
38
39
39
# What’s new in the 0.16.0-RC3 technology preview?
40
40
41
- <!-- https://github.com/lampepfl/dotty/pulls?q=is%3Apr+closed%3A%3E2019-05-23+is%3Aclosed+sort%3Acomments-desc -->
42
-
43
41
## Syntax Change: Type Lambdas
44
42
45
43
We reconsider the syntax of type lambdas in an effort to provide an improved
@@ -72,7 +70,7 @@ aligns with Java's syntax.
72
70
For more information please read our documentation on
73
71
[ Wildcards] ( https://dotty.epfl.ch/docs/reference/changed-features/wildcards.html ) .
74
72
75
- # Syntax Change: Contextual Abstractions
73
+ ## Syntax Change: Contextual Abstractions
76
74
77
75
We reconsider the syntax for contextual abstractions introducing ` delegates `
78
76
(formerly known as ` implied ` ). ` delegate ` , in the context of contextual
@@ -131,7 +129,7 @@ With PFTs we can now achieve what we want:
131
129
For those who are interested in the discussions and more test cases,
132
130
[# 4672 ](https:// github.com/ lampepfl/ dotty/ pull/ 4672 / ) introduced PFTs .
133
131
134
- ## lazy vals are now thread- safe by default
132
+ ## ` lazy val`s are now thread- safe by default
135
133
136
134
Previously thread- safety was required using `@volatile` but that would not be
137
135
consistent with Scala 2 . The old behavior of non- volatile lazy vals can be
@@ -140,6 +138,31 @@ recovered by using the newly-introduced `@threadUnsafe`.
140
138
For more information please read our documentation on the
141
139
[threadUnsafe annotation](https:// dotty.epfl.ch/ docs/ reference/ other- new - features/ threadUnsafe- annotation.html).
142
140
141
+ ## Add support for Java - compatible enums
142
+
143
+ We add support for Java - compatible enumerations. The users can just extend
144
+ `java.lang.Enum[T]`.
145
+
146
+ ```scala
147
+ enum A extends java.lang.Enum [A ] {
148
+ case MONDAY , TUESDAY , SATURDAY
149
+ }
150
+
151
+ enum B (val gravity : Double ) extends java.lang.Enum [B ] {
152
+ case EARTH extends B (9.8 )
153
+ case JUPITER extends B (100 )
154
+ case MOON extends B (4.3 )
155
+ case Foo extends B (10 )
156
+ }
157
+ ```
158
+
159
+ For more information please check the [test case ](https:// github.com/ lampepfl/ dotty/ tree/ master/ tests/ run/ enum - java) and
160
+ also the relevant PRs [# 6602 ](https:// github.com/ lampepfl/ dotty/ pull/ 6602 ) and
161
+ [# 6629 ](https:// github.com/ lampepfl/ dotty/ pull/ 6629 ).
162
+
163
+ In the test, the enums are defined in the `MainScala.scala` file and used from a
164
+ Java source, `Test.java`.
165
+
143
166
## Introducing `for` clauses for importing delegate imports by type
144
167
145
168
Since delegate instances can be anonymous it is not always practical to import
0 commit comments