proc: allow use of quoted type names in type casts (#434)

If we are unable to correctly guess how a type is serialized in
debug_info let the user specify it directly.

Workaround for #455
This commit is contained in:
Alessandro Arzilli
2016-04-25 01:14:42 +02:00
committed by Derek Parker
parent 7820921b7e
commit a7a0cc75e1
5 changed files with 61 additions and 5 deletions

View File

@ -41,7 +41,13 @@ func (scope *EvalScope) evalAST(t ast.Expr) (*Variable, error) {
if err == nil {
return v, nil
}
if err != reader.TypeNotFoundErr {
_, isident := node.Fun.(*ast.Ident)
// we don't support function calls at the moment except for a few
// builtin functions so just return the type error here if the function
// isn't an identifier.
// More sophisticated logic will be required when function calls
// are implemented.
if err != reader.TypeNotFoundErr || !isident {
return v, err
}
}