Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3223

TypeScript: Add initial support for Enum Maps

    XMLWordPrintableJSON

Details

    • Patch Available
    • Patch

    Description

      This patch improve the generation of maps with enums. More improvements can be done but we need to have this issue solved first: https://github.com/Microsoft/TypeScript/pull/2652

      Old Code:

      enum BarTypes {
        A = 0,
        B = 1
      }
      class Bar {
      }
      class Foo {
        bars: any;
      }
      

      New Code:

      enum BarTypes {
        A = 0,
        B = 1
      }
      class Bar {
      }
      class Foo {
        bars: { [k: number /*BarTypes*/]: Bar;
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            fbarriga Felipe Barriga Richards
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: