From 5261be20ebafedd878ccc22aa716ee4af7ddd16e Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 21 Aug 2009 17:42:41 -0700 Subject: [PATCH] A test for an interface which uses a forward declared type which turns out to be invalid. R=rsc DELTA=15 (15 added, 0 deleted, 0 changed) OCL=33691 CL=33693 --- test/bugs/bug195.go | 12 ++++++++++++ test/golden.out | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 test/bugs/bug195.go diff --git a/test/bugs/bug195.go b/test/bugs/bug195.go new file mode 100644 index 00000000000..4d679e2f347 --- /dev/null +++ b/test/bugs/bug195.go @@ -0,0 +1,12 @@ +// 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 I1 interface { I2 } // ERROR "interface" +type I2 int + +type I3 interface { int } // ERROR "interface" diff --git a/test/golden.out b/test/golden.out index a813eba85f6..207313f5902 100644 --- a/test/golden.out +++ b/test/golden.out @@ -177,3 +177,6 @@ errchk: bugs/bug193.go:14: missing expected error: 'shift' =========== bugs/bug194.go BUG should compile and run $RUNFILE: line 1: PID Segmentation fault (core dumped) $G $D/$F.go + +=========== bugs/bug195.go +bugs/bug195.go:9: BUG: errchk: compiler crashed