Commit 703b897f authored by Rob Pike's avatar Rob Pike

cmd/gc: remove mentions of "ideal" from error messages.

        _ = 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
parent 3495aa29
......@@ -1056,7 +1056,7 @@ nodcplxlit(Val r, Val i)
}
// 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)
{
......
......@@ -577,7 +577,7 @@ basicnames[] =
[TANY] = "any",
[TSTRING] = "string",
[TNIL] = "nil",
[TIDEAL] = "ideal",
[TIDEAL] = "untyped number",
[TBLANK] = "blank",
};
......@@ -619,7 +619,7 @@ typefmt(Fmt *fp, Type *t)
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]);
}
......
......@@ -90,7 +90,7 @@ static char* _typekind[] = {
[TARRAY] = "array",
[TFUNC] = "func",
[TNIL] = "nil",
[TIDEAL] = "ideal number",
[TIDEAL] = "untyped number",
};
static char*
......
Markdown is supported
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