Skip to content

Commit

Permalink
a real fix for issue261
Browse files Browse the repository at this point in the history
  • Loading branch information
awalterschulze committed Feb 26, 2017
1 parent 1df7742 commit 83faaee
Show file tree
Hide file tree
Showing 3 changed files with 218 additions and 13 deletions.
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -107,6 +107,7 @@ regenerate:
make -C test/data regenerate
make -C test/typedecl regenerate
make -C test/issue260 regenerate
make -C test/issue261 regenerate
make -C test/issue262 regenerate
make -C test/enumdecl regenerate
make -C test/typedecl_all regenerate
Expand Down
4 changes: 2 additions & 2 deletions plugin/unmarshal/unmarshal.go
Expand Up @@ -735,10 +735,10 @@ func (p *unmarshal) field(file *generator.FileDescriptor, msg *generator.Descrip

// if the map type is an alias and key or values are aliases (type Foo map[Bar]Baz),
// we need to explicitly record their use here.
if m.KeyField != m.KeyAliasField {
if gogoproto.IsCastKey(field) {
p.RecordTypeUse(m.KeyAliasField.GetTypeName())
}
if m.ValueField != m.ValueAliasField {
if gogoproto.IsCastValue(field) {
p.RecordTypeUse(m.ValueAliasField.GetTypeName())
}

Expand Down
226 changes: 215 additions & 11 deletions test/issue261/issue261.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 83faaee

Please sign in to comment.