@@ -7,20 +7,23 @@ import annotation.experimental
7
7
/** The universal capture reference */
8
8
val `*` : Any = ()
9
9
10
- /** If argument is of type `cs T`, converts to type `box cs T`. This
11
- * avoids the error that would be raised when boxing `*`.
12
- */
13
- extension [T ](x : T ) def unsafeBox : T = x
10
+ object unsafe :
14
11
15
- /** If argument is of type `box cs T`, converts to type `cs T`. This
16
- * avoids the error that would be raised when unboxing `*`.
17
- */
18
- extension [T ](x : T ) def unsafeUnbox : T = x
12
+ /** If argument is of type `cs T`, converts to type `box cs T`. This
13
+ * avoids the error that would be raised when boxing `*`.
14
+ */
15
+ extension [T ](x : T ) def unsafeBox : T = x
19
16
20
- /** If argument is of type `box cs T`, converts to type `cs T`. This
21
- * avoids the error that would be raised when unboxing `*`.
22
- */
23
- extension [T , U ](f : T => U ) def unsafeBoxFunArg : T => U = f
17
+ /** If argument is of type `box cs T`, converts to type `cs T`. This
18
+ * avoids the error that would be raised when unboxing `*`.
19
+ */
20
+ extension [T ](x : T ) def unsafeUnbox : T = x
21
+
22
+ /** If argument is of type `box cs T`, converts to type `cs T`. This
23
+ * avoids the error that would be raised when unboxing `*`.
24
+ */
25
+ extension [T , U ](f : T => U ) def unsafeBoxFunArg : T => U = f
26
+ end unsafe
24
27
25
28
/** Mixing in this trait forces a trait or class to be pure, i.e.
26
29
* have no capabilities retained in its self type.
0 commit comments