Commit 57e84951 authored by Hugo Moreau's avatar Hugo Moreau
Browse files

transform/checktype.go: non-int global values pass

In order to integrate global variables, a new pass has been created in
order to ignore non-integer values.

* transform/checktype.go : Here.
parent 4835dbce
Pipeline #14591 passed with stage
in 1 minute and 37 seconds
......@@ -63,6 +63,15 @@ func (t *TypeChecker) Pre(meta *Meta, v *Visitor) bool {
panic("Structs are not supported.")
case *ast.SwitchStmt:
panic("Switch are not supported.")
case *ast.ValueSpec:
for i := 0; i < len(node.Values); i++ {
switch value := node.Values[i].(type) {
case *ast.BasicLit:
if value.Kind != token.INT {
panic("Non integer global values are not supported.")
return true
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment