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

TypeScript: Add initial support for Enum Maps

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment