]> Cypherpunks repositories - gostls13.git/commitdiff
bug 149
authorKen Thompson <ken@golang.org>
Fri, 29 May 2009 20:44:30 +0000 (13:44 -0700)
committerKen Thompson <ken@golang.org>
Fri, 29 May 2009 20:44:30 +0000 (13:44 -0700)
R=r
OCL=29612
CL=29612

src/cmd/gc/const.c
test/fixedbugs/bug149.go [moved from test/bugs/bug149.go with 100% similarity]
test/golden.out

index d672ec9f09646707f4357b9a0f8e89c1bfefb0bd..147af4fe39b68489e77de9bf7432b812c8b7684c 100644 (file)
@@ -83,7 +83,6 @@ convlit1(Node *n, Type *t, int explicit)
                n->type = n->left->type;
                return;
        }
-
        // avoided repeated calculations, errors
        if(cvttype(n->type, t)) {
                n->type = t;
@@ -127,6 +126,10 @@ convlit1(Node *n, Type *t, int explicit)
                default:
                        goto bad;
 
+               case TSTRING:
+                       // let normal conversion code handle it
+                       return;
+
                case TPTR32:
                case TPTR64:
                case TINTER:
similarity index 100%
rename from test/bugs/bug149.go
rename to test/fixedbugs/bug149.go
index 6bc8837d49c7569b32001e9ab5adf128d1ad70de..b5dbddffe62148ed9bdc8144bd8d87d63cbc7e5f 100644 (file)
@@ -104,10 +104,6 @@ BUG should compile
 5 7
 BUG: should crash
 
-=========== bugs/bug149.go
-bugs/bug149.go:14: cannot convert []uint8 constant to string
-BUG: should compile
-
 =========== fixedbugs/bug016.go
 fixedbugs/bug016.go:7: constant -3 overflows uint
 
@@ -142,7 +138,6 @@ fixedbugs/bug039.go:6: variable x redeclared in this block
 fixedbugs/bug041.go:5: export of incomplete type t
 
 =========== fixedbugs/bug049.go
-fixedbugs/bug049.go:6: cannot convert nil constant to string
 fixedbugs/bug049.go:6: illegal types for operand: EQ
        string
        nil
@@ -154,7 +149,6 @@ fixedbugs/bug050.go:3: package statement must be first
 fixedbugs/bug051.go:10: expression must be a constant
 
 =========== fixedbugs/bug062.go
-fixedbugs/bug062.go:6: cannot convert nil constant to string
 fixedbugs/bug062.go:6: illegal types for operand: AS
        string
        nil