| 1 |
// Copyright 2021 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
package a |
| 6 |
|
| 7 |
type Node interface { |
| 8 |
Position() |
| 9 |
} |
| 10 |
|
| 11 |
type noder struct{} |
| 12 |
|
| 13 |
func (noder) Position() {} |
| 14 |
|
| 15 |
type Scope map[int][]Node |
| 16 |
|
| 17 |
func (s Scope) M1() Scope { |
| 18 |
if x, ok := s[0]; ok { |
| 19 |
return x[0].(struct { |
| 20 |
noder |
| 21 |
Scope |
| 22 |
}).Scope |
| 23 |
} |
| 24 |
return nil |
| 25 |
} |
| 26 |
|
| 27 |
func (s Scope) M2() Scope { |
| 28 |
if x, ok := s[0]; ok { |
| 29 |
st, _ := x[0].(struct { |
| 30 |
noder |
| 31 |
Scope |
| 32 |
}) |
| 33 |
return st.Scope |
| 34 |
} |
| 35 |
return nil |
| 36 |
} |