Russ Cox | 2b1c9b4 | 2012-02-16 23:49:30 -0500 | [diff] [blame] | 1 | // compile |
Robert Griesemer | 08b5993 | 2008-07-14 16:26:41 -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 | |
Brad Fitzpatrick | 040fe32 | 2012-02-03 11:43:24 -0800 | [diff] [blame] | 7 | package bug066 |
Robert Griesemer | 08b5993 | 2008-07-14 16:26:41 -0700 | [diff] [blame] | 8 | |
Russ Cox | 839a684 | 2009-01-20 14:40:40 -0800 | [diff] [blame] | 9 | type Scope struct { |
Russ Cox | 08ca30b | 2008-12-19 03:05:37 -0800 | [diff] [blame] | 10 | entries map[string] *Object; |
Robert Griesemer | 08b5993 | 2008-07-14 16:26:41 -0700 | [diff] [blame] | 11 | } |
| 12 | |
| 13 | |
Russ Cox | 839a684 | 2009-01-20 14:40:40 -0800 | [diff] [blame] | 14 | type Type struct { |
Robert Griesemer | 08b5993 | 2008-07-14 16:26:41 -0700 | [diff] [blame] | 15 | scope *Scope; |
| 16 | } |
| 17 | |
| 18 | |
Russ Cox | 839a684 | 2009-01-20 14:40:40 -0800 | [diff] [blame] | 19 | type Object struct { |
Robert Griesemer | 08b5993 | 2008-07-14 16:26:41 -0700 | [diff] [blame] | 20 | typ *Type; |
| 21 | } |
| 22 | |
| 23 | |
Russ Cox | 839a684 | 2009-01-20 14:40:40 -0800 | [diff] [blame] | 24 | func Lookup(scope *Scope) *Object { |
Robert Griesemer | 08b5993 | 2008-07-14 16:26:41 -0700 | [diff] [blame] | 25 | return scope.entries["foo"]; |
| 26 | } |