aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile')
-rw-r--r--src/cmd/compile/internal/types2/builtins.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types2/builtins.go b/src/cmd/compile/internal/types2/builtins.go
index f3763862ec..7a209e7a97 100644
--- a/src/cmd/compile/internal/types2/builtins.go
+++ b/src/cmd/compile/internal/types2/builtins.go
@@ -576,6 +576,11 @@ func (check *Checker) builtin(x *operand, call *syntax.CallExpr, id builtinId) (
// If nargs == 1, make sure x.mode is either a value or a constant.
if x.mode != constant_ {
x.mode = value
+ // A value must not be untyped.
+ check.assignment(x, &emptyInterface, "argument to "+bin.name)
+ if x.mode == invalid {
+ return
+ }
}
// Use the final type computed above for all arguments.