1
0
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:
Russ Cox 2009-12-03 01:12:02 -08:00
parent 41861a8812
commit 05a1eb1ab0
3 changed files with 15 additions and 0 deletions

View File

@ -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'])

View File

@ -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
View 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"