]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: remove mentions of "ideal" from error messages.
authorRob Pike <r@golang.org>
Fri, 16 Aug 2013 02:40:02 +0000 (12:40 +1000)
committerRob Pike <r@golang.org>
Fri, 16 Aug 2013 02:40:02 +0000 (12:40 +1000)
        _ = 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

src/cmd/gc/const.c
src/cmd/gc/fmt.c
src/cmd/gc/typecheck.c

index e9d99df18b02d0b504e58f8294170d2c7246d5ba..cfb1f0adef22f638b8aded22b827afd0d9c4b935 100644 (file)
@@ -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)
 {
index ded78628e4116ccff89adb0498d6504cb92f0998..8673b39ce6987d1bd6bfd902dc0b45345f5d5399 100644 (file)
@@ -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]);
        }
 
index f232efdaf86ecb61c2ce0efd3059ac0d884fe773..9b5a784eb1ea04eed3e7d2145b574b5dabbb3139 100644 (file)
@@ -90,7 +90,7 @@ static char* _typekind[] = {
        [TARRAY]        = "array",
        [TFUNC]         = "func",
        [TNIL]          = "nil",
-       [TIDEAL]        = "ideal number",
+       [TIDEAL]        = "untyped number",
 };
 
 static char*