Message ID | mcrk4fmjuz6.fsf@google.com |
---|---|
State | New |
Headers | show |
diff -r d04de877d993 go/gogo.cc --- a/go/gogo.cc Fri Mar 25 22:31:14 2011 -0700 +++ b/go/gogo.cc Fri Mar 25 22:41:02 2011 -0700 @@ -1527,7 +1527,9 @@ && !ctype->is_boolean_type() && !ctype->is_string_type()) { - if (!ctype->is_error()) + if (ctype->is_nil_type()) + error_at(constant->location(), "const initializer cannot be nil"); + else if (!ctype->is_error()) error_at(constant->location(), "invalid constant type"); constant->set_error(); }