1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:04:41 -07:00

gc: bug241

Fixes #495.

R=ken2
CC=golang-dev
https://golang.org/cl/183156
This commit is contained in:
Russ Cox 2010-01-07 23:20:00 -08:00
parent f3e7ddc2fb
commit c6f4d68667
2 changed files with 14 additions and 1 deletions

View File

@ -446,7 +446,9 @@ reswitch:
n->op = ODOT;
// fall through
case ODOT:
l = typecheck(&n->left, Erv|Etype);
typecheck(&n->left, Erv|Etype);
defaultlit(&n->left, T);
l = n->left;
if((t = l->type) == T)
goto error;
if(n->right->op != ONAME) {

11
test/fixedbugs/bug241.go Normal file
View File

@ -0,0 +1,11 @@
// errchk $G $D/$F.go
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
const c = 3
var x = c.String() // ERROR "String"