func (v *evalVariableAccess) Eval(scope ast.Scope, _ *ast.Stack) (interface{}, ast.Type, error) { // Look up the variable in the map variable, ok := scope.LookupVar(v.Name) if !ok { return nil, ast.TypeInvalid, fmt.Errorf( "unknown variable accessed: %s", v.Name) } return variable.Value, variable.Type, nil }
func (v *evalVariableAccess) Eval(scope ast.Scope, _ *ast.Stack) (interface{}, ast.Type, error) { // Look up the variable in the map variable, ok := scope.LookupVar(v.Name) if !ok { return nil, ast.TypeInvalid, fmt.Errorf( "unknown variable accessed: %s", v.Name) } // Check if the variable contains any unknown types. If so, then // mark it as unknown and return that type. if ast.IsUnknown(variable) { return nil, ast.TypeUnknown, nil } return variable.Value, variable.Type, nil }