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

Create an "include" annotation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • None
    • None
    • Java - Compiler
    • None

    Description

      The intention of this idea is to minimize the amount of typing necessary to navigate thrift structures. The idea is to be able to "include" a field within a struct, like so (I don't know the syntax of Thrift annotations but this is the idea):

      struct B {
      1: required i32 f1;
      2: required i32 f2;
      }

      struct A {

      1: @include required B b;
      2: required i32 field2;
      }

      If we have an instance of A named "a", we can access the inner B's fields by saying "a.get_f1()".

      There's the obvious problem of name conflicts, but I think it's fine to leave it to the programmer to make sure the code is safe.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              marz Nathan Marz
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: