File tree 1 file changed +3
-3
lines changed
docs/docs/reference/other-new-features 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ object Logarithms {
23
23
given logarithmOps : (x : Logarithm ) extended with {
24
24
def toDouble : Double = math.exp(x)
25
25
def + (y : Logarithm ): Logarithm = Logarithm (math.exp(x) + math.exp(y))
26
- def * (y : Logarithm ): Logarithm = Logarithm ( x + y)
26
+ def * (y : Logarithm ): Logarithm = x + y
27
27
}
28
28
}
29
29
```
@@ -69,15 +69,15 @@ object Access {
69
69
opaque type PermissionChoice = Int
70
70
opaque type Permission <: Permissions & PermissionChoice = Int
71
71
72
- def (x : Permissions ) & (y : Permissions ): Permissions = x & y
72
+ def (x : Permissions ) & (y : Permissions ): Permissions = x | y
73
73
def (x : PermissionChoice ) | (y : PermissionChoice ): PermissionChoice = x | y
74
74
def (x : Permissions ) is (y : Permissions ) = (x & y) == y
75
75
def (x : Permissions ) isOneOf (y : PermissionChoice ) = (x & y) != 0
76
76
77
77
val NoPermission : Permission = 0
78
78
val ReadOnly : Permission = 1
79
79
val WriteOnly : Permission = 2
80
- val ReadWrite : Permissions = ReadOnly & WriteOnly
80
+ val ReadWrite : Permissions = ReadOnly | WriteOnly
81
81
val ReadOrWrite : PermissionChoice = ReadOnly | WriteOnly
82
82
}
83
83
```
You can’t perform that action at this time.
0 commit comments