Skip to content

Commit

Permalink
fix: Fix coercion of i64 keys in map
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Hayes committed Nov 20, 2018
1 parent 444d9d4 commit 5e1581c
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 84 deletions.
4 changes: 3 additions & 1 deletion src/main/render/thrift-server/struct/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ export function loopOverContainer(
const valueParam: ts.Identifier = ts.createUniqueName('value')
const valueConst: ts.Identifier = ts.createUniqueName('value')
const keyName: ts.Identifier = ts.createUniqueName('key')
const keyConst: ts.Identifier = ts.createUniqueName('key')
return [
ts.createStatement(ts.createCall(
ts.createPropertyAccess(
Expand Down Expand Up @@ -512,7 +513,8 @@ export function loopOverContainer(
ts.createToken(ts.SyntaxKind.EqualsGreaterThanToken),
ts.createBlock([
...assignmentForFieldType(field, fieldType.valueType, valueConst, valueParam, identifiers),
createMethodCallStatement(saveName, 'set', [ keyName, valueConst ]),
...assignmentForFieldType(field, fieldType.keyType, keyConst, keyName, identifiers),
createMethodCallStatement(saveName, 'set', [ keyConst, valueConst ]),
], true),
),
],
Expand Down
Loading

0 comments on commit 5e1581c

Please sign in to comment.