Commit 05a1eb1a authored by Russ Cox's avatar Russ Cox

gc: recursive type error

Fixes #245.

R=ken2
https://golang.org/cl/164094
parent 41861a88
......@@ -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;
}
......
// 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"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment