From: Rob Pike Date: Fri, 26 Jun 2009 01:44:28 +0000 (-0700) Subject: cannot have interfaces refer to themselves as map keys X-Git-Tag: weekly.2009-11-06~1322 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7de48834122bda8b3ba1d52025eb53bdf19f1718;p=gostls13.git cannot have interfaces refer to themselves as map keys R=rsc DELTA=11 (11 added, 0 deleted, 0 changed) OCL=30774 CL=30774 --- 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