diff mbox

Go patch committed: Fix type of string slice

Message ID mcrei8gm4fm.fsf@google.com
State New
Headers show

Commit Message

Ian Lance Taylor Jan. 14, 2011, 5:37 a.m. UTC
When taking a slice of a string, the type of the result is the type of
the string, which matters if it is a named type.  The Go frontend got
this wrong, and this patch corrects it.  Bootstrapped and tested on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
diff mbox

Patch

diff -r a8e0fd59797d go/expressions.cc
--- a/go/expressions.cc	Thu Jan 13 16:54:22 2011 -0800
+++ b/go/expressions.cc	Thu Jan 13 21:32:14 2011 -0800
@@ -9541,7 +9541,7 @@ 
   if (this->end_ == NULL)
     return Type::lookup_integer_type("uint8");
   else
-    return Type::make_string_type();
+    return this->string_->type();
 }
 
 // Determine the type of a string index.