Files
moxa/_test/a42.go
Nicholas Wiersma 913680d1ed feat: add call expression (not builtin) type checking
This adds type checking to CallExpr (excluding builtin type checking, as that is a PR in its own right) as well as handling any required constant type conversion.

This also changes constant strings and runes to be represented as `constant.Value`. Runes change `rval` type at CFG typing time to avoid having to type at AST time. There are also changes to importSpecs and `stdlib` to account for the string change. With this all `untyped` types should now be `constant.Value`s, although errors are still not returned if this is not the case to be sure we do not break things.

This also fixed a bug in `itype.methods` that would panic if the type was recursive.
2020-08-14 12:02:04 +02:00

17 lines
181 B
Go

package main
import (
"encoding/binary"
"fmt"
)
func main() {
var b [8]byte
binary.LittleEndian.PutUint64(b[:], uint64(1))
fmt.Println(b)
}
// Output:
// [1 0 0 0 0 0 0 0]