java2typescript icon indicating copy to clipboard operation
java2typescript copied to clipboard

`Map<Integer, WhatEver> x` produces field with `string` key instead of `number` key

Open atsu85 opened this issue 7 years ago • 1 comments

Generating TypeScript from

class Bug {
  Map<Integer, String> intKeyMap;
}

produces

export interface Bug {
    intKeyMap: { [key: string ]: string;};
  // intKeyMap: { [key: number]: string;}; // <-- EXPECTED
}

but expecting number to be the key instead of string

atsu85 avatar Mar 26 '17 23:03 atsu85

I think objects in JS always are keyed by string.

crummy avatar Nov 09 '21 19:11 crummy