OLD | NEW |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // This file implements the universe and unsafe package scopes. | 5 // This file implements the universe and unsafe package scopes. |
6 | 6 |
7 package types | 7 package types |
8 | 8 |
9 import ( | 9 import ( |
10 "go/ast" | 10 "go/ast" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 if ast.IsExported(name) { | 152 if ast.IsExported(name) { |
153 scope = unsafe | 153 scope = unsafe |
154 } | 154 } |
155 if scope.Insert(obj) != nil { | 155 if scope.Insert(obj) != nil { |
156 panic("internal error: double declaration") | 156 panic("internal error: double declaration") |
157 } | 157 } |
158 obj.Decl = scope | 158 obj.Decl = scope |
159 } | 159 } |
160 return obj | 160 return obj |
161 } | 161 } |
OLD | NEW |