From 7de48834122bda8b3ba1d52025eb53bdf19f1718 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Thu, 25 Jun 2009 18:44:28 -0700 Subject: [PATCH] cannot have interfaces refer to themselves as map keys R=rsc DELTA=11 (11 added, 0 deleted, 0 changed) OCL=30774 CL=30774 --- test/bugs/bug165.go | 11 +++++++++++ test/golden.out | 4 ++++ 2 files changed, 15 insertions(+) create mode 100644 test/bugs/bug165.go diff --git a/test/bugs/bug165.go b/test/bugs/bug165.go new file mode 100644 index 0000000000..02a6c379b4 --- /dev/null +++ b/test/bugs/bug165.go @@ -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 + +type I interface { + m(map[I] bool) +} diff --git a/test/golden.out b/test/golden.out index 695a68cd41..09ac96269a 100644 --- a/test/golden.out +++ b/test/golden.out @@ -111,6 +111,10 @@ BUG: should not compile =========== bugs/bug164.go BUG: should not compile +=========== bugs/bug165.go +bugs/bug165.go:6: invalid map key type I +BUG: should compile + =========== fixedbugs/bug016.go fixedbugs/bug016.go:7: constant -3 overflows uint -- 2.48.1