Type checking on shift operands was failing for untyped variable values. Fix propagation of type in assignment. Optimize assignment of arithmetic operations on variables by skipping the assign and writing directly to destination frame value in the operator function. Skip some slow tests when given -short test option. Fixes #917.
16 lines
135 B
Go
16 lines
135 B
Go
package main
|
|
|
|
type H struct {
|
|
bits uint
|
|
}
|
|
|
|
func main() {
|
|
h := &H{8}
|
|
var x uint = (1 << h.bits) >> 6
|
|
|
|
println(x)
|
|
}
|
|
|
|
// Output:
|
|
// 4
|