Commit 1a99094 1 parent 253c766 commit 1a99094 Copy full SHA for 1a99094
File tree 4 files changed +41
-2
lines changed
4 files changed +41
-2
lines changed Original file line number Diff line number Diff line change @@ -113,8 +113,8 @@ func (m *Machine) doOpUxor() {
113
113
case Uint64Type :
114
114
xv .SetUint64 (^ xv .GetUint64 ())
115
115
case UntypedBigintType :
116
- // XXX can it even be implemented?
117
- panic ( "not yet implemented" )
116
+ bv := xv . V .( BigintValue )
117
+ xv . V = BigintValue { V : new (big. Int ). Not ( bv . V )}
118
118
default :
119
119
panic (fmt .Sprintf ("unexpected type %s in operation" ,
120
120
baseOf (xv .T )))
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ const (
4
+ A = ^0
5
+ B = ^1
6
+ C = int8(^1)
7
+ D = ^uint8(1)
8
+ )
9
+
10
+ func main() {
11
+ println(A, B, C, D)
12
+ }
13
+
14
+ // Output:
15
+ // -1 -2 -2 254
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ const (
4
+ A = uint(^1)
5
+ )
6
+
7
+ func main() {
8
+ println(A)
9
+ }
10
+
11
+ // Error:
12
+ // main/files/const60.gno:4:6: bigint underflows target kind
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ const (
4
+ A = uint8(^0)
5
+ )
6
+
7
+ func main() {
8
+ println(A)
9
+ }
10
+
11
+ // Error:
12
+ // main/files/const61.gno:4:6: bigint underflows target kind
You can’t perform that action at this time.
0 commit comments