The export data is a serialized description of the graph of exported
"objects": constants, types, variables, and functions. Aliases may be
directly reexported, and unaliased types may be indirectly reexported
-(as part of the type of a directly exorted object). More generally,
+(as part of the type of a directly exported object). More generally,
objects referred to from inlined function bodies can be reexported.
We need to know which package declares these reexported objects, and
therefore packages are also part of the export graph.
}
name := p.name()
- // permit both: type T => p.T and: type T = p.T for now
- if p.got(_Rarrow) || p.got(_Assign) {
+ if p.got(_Rarrow) {
return p.aliasDecl(Type, name, group)
}
}
ident := p.parseIdent()
- // permit both: type T => p.T and: type T = p.T for now
- if p.tok == token.ALIAS || p.tok == token.ASSIGN {
+ if p.tok == token.ALIAS {
p.next()
return p.parseAliasSpec(doc, ast.Typ, ident)
}
`package p; var _ = map[P]int{P{}:0, {}:1}`,
`package p; var _ = map[*P]int{&P{}:0, {}:1}`,
`package p; const c => p.C; var x => X; type T => p.T; func F => p.F`,
- `package p; var (_ int; x => p.X; y => Y); type (t => T; t1 = p.T1)`,
+ `package p; var (_ int; x => p.X; y => Y); type (t => T; t1 => p.T1)`,
}
func TestValid(t *testing.T) {
type (
s struct{}
a => A
- b => A
- c => foo
ddd => p.Foo
)
type (
s struct{}
a => A
- b = A
- c = foo
ddd => p.Foo
)