Russ Cox | 2b1c9b4 | 2012-02-16 23:49:30 -0500 | [diff] [blame] | 1 | // run |
Robert Griesemer | 2b8db5a | 2008-06-26 15:15:38 -0700 | [diff] [blame] | 2 | |
| 3 | // Copyright 2009 The Go Authors. All rights reserved. |
| 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
| 7 | package main |
| 8 | |
Russ Cox | 839a684 | 2009-01-20 14:40:40 -0800 | [diff] [blame] | 9 | type Box struct {}; |
Russ Cox | 08ca30b | 2008-12-19 03:05:37 -0800 | [diff] [blame] | 10 | var m map[string] *Box; |
| 11 | |
Robert Griesemer | 2b8db5a | 2008-06-26 15:15:38 -0700 | [diff] [blame] | 12 | func main() { |
Rob Pike | 74dd0ab | 2009-08-17 13:30:22 -0700 | [diff] [blame] | 13 | m := make(map[string] *Box); |
| 14 | s := "foo"; |
| 15 | var x *Box = nil; |
| 16 | m[s] = x; |
Robert Griesemer | 2b8db5a | 2008-06-26 15:15:38 -0700 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | /* |
| 20 | bug058.go:9: illegal types for operand: INDEX |
| 21 | (MAP[<string>*STRING]*<Box>{}) |
| 22 | (<string>*STRING) |
| 23 | */ |