File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
docs/docs/reference/other-new-features Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ object Logarithms {
2323 given logarithmOps : (x : Logarithm ) extended with {
2424 def toDouble : Double = math.exp(x)
2525 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
2727 }
2828}
2929```
@@ -69,15 +69,15 @@ object Access {
6969 opaque type PermissionChoice = Int
7070 opaque type Permission <: Permissions & PermissionChoice = Int
7171
72- def (x : Permissions ) & (y : Permissions ): Permissions = x & y
72+ def (x : Permissions ) & (y : Permissions ): Permissions = x | y
7373 def (x : PermissionChoice ) | (y : PermissionChoice ): PermissionChoice = x | y
7474 def (x : Permissions ) is (y : Permissions ) = (x & y) == y
7575 def (x : Permissions ) isOneOf (y : PermissionChoice ) = (x & y) != 0
7676
7777 val NoPermission : Permission = 0
7878 val ReadOnly : Permission = 1
7979 val WriteOnly : Permission = 2
80- val ReadWrite : Permissions = ReadOnly & WriteOnly
80+ val ReadWrite : Permissions = ReadOnly | WriteOnly
8181 val ReadOrWrite : PermissionChoice = ReadOnly | WriteOnly
8282}
8383```
You can’t perform that action at this time.
0 commit comments