GitHub user dhull opened a pull request:
https://github.com/apache/thrift/pull/1495
THRIFT-4497: Use map() field type for Erlang type for map struct fields
The Thrift Erlang code generator previously generated fields with the `#{}`
Erlang type for maps fields. In the Erlang type specification languages,
however, `#{}` specifically means an empty map. This commit fixes the code to
emit `map()` instead, which means the maps keys and values may be of any type.
It would be possible to emit a field type such as `${keytype() =>
maptype()}`, but this commit does not do that.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dhull/thrift thrift-4497-erlang-maps
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/1495.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1495
commit 67f7f6343f71da75b8f2257a8bb63d2ebd48dc82
Author: David Hull
Date: 2018-02-14T03:41:35Z
THRIFT-4497: Use `map()` field type for Erlang type for map struct fields.
The Thrift Erlang code generator previously generated fields with the
`#{}` Erlang type for maps fields. In the Erlang type specification
languages, however, `#{}` specifically means an empty map. This commit
fixes the code to emit `map()` instead, which means the maps keys and
values may be of any type.
It would be possible to emit a field type such as
`${keytype() => maptype()}`, but this commit does not do that.
---