You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Literal Singleton Types allows primitive literals to be used as types. For example:
7
+
8
+
```scala
9
+
valt:42=42
10
+
valx:"Jedi"="Jedi"
11
+
```
12
+
13
+
It is also possible to define functions returning or taking singleton types such as
14
+
15
+
```scala
16
+
deff(t: Double): t.type= t
17
+
vala:1.2= f(1.2)
18
+
```
19
+
20
+
For more details and the motivation behind the need for literal singleton types, check out [SIP-23](http://docs.scala-lang.org/sips/pending/42.type.html)
0 commit comments