mirror of
https://github.com/golang/go
synced 2024-11-22 01:04:40 -07:00
gc: recursive type error
Fixes #245. R=ken2 https://golang.org/cl/164094
This commit is contained in:
parent
41861a8812
commit
05a1eb1ab0
@ -205,6 +205,9 @@ dowidth(Type *t)
|
||||
checkwidth(t->down);
|
||||
break;
|
||||
case TFORW: // should have been filled in
|
||||
yyerror("invalid recursive type %T", t);
|
||||
w = 1; // anything will do
|
||||
break;
|
||||
case TANY:
|
||||
// dummy type; should be replaced before use.
|
||||
if(!debug['A'])
|
||||
|
@ -1039,6 +1039,8 @@ reswitch:
|
||||
case ODCLTYPE:
|
||||
ok |= Etop;
|
||||
typecheck(&n->left, Etype);
|
||||
if(!incannedimport)
|
||||
checkwidth(n->left->type);
|
||||
goto ret;
|
||||
}
|
||||
|
||||
|
10
test/fixedbugs/bug224.go
Normal file
10
test/fixedbugs/bug224.go
Normal file
@ -0,0 +1,10 @@
|
||||
// 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
|
||||
|
||||
type T T // ERROR "recursive"
|
||||
|
Loading…
Reference in New Issue
Block a user