_ = complex("foo", 0)
_ = complex(true, 0)
now trigger:
x.go:4: invalid operation: complex("foo", 0) (mismatched types untyped string and untyped number)
x.go:5: invalid operation: complex(true, 0) (mismatched types untyped bool and untyped number)
Fixes #4521
R=golang-dev, remyoudompheng, rsc
CC=golang-dev
https://golang.org/cl/
12973043
}
// idealkind returns a constant kind like consttype
-// but for an arbitrary "ideal" expression.
+// but for an arbitrary "ideal" (untyped constant) expression.
static int
idealkind(Node *n)
{
[TANY] = "any",
[TSTRING] = "string",
[TNIL] = "nil",
- [TIDEAL] = "ideal",
+ [TIDEAL] = "untyped number",
[TBLANK] = "blank",
};
if(t->etype < nelem(basicnames) && basicnames[t->etype] != nil) {
if(fmtmode == FErr && (t == idealbool || t == idealstring))
- fmtstrcpy(fp, "ideal ");
+ fmtstrcpy(fp, "untyped ");
return fmtstrcpy(fp, basicnames[t->etype]);
}
[TARRAY] = "array",
[TFUNC] = "func",
[TNIL] = "nil",
- [TIDEAL] = "ideal number",
+ [TIDEAL] = "untyped number",
};
static char*