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

Dart generator does not name imports

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.10.0
    • Dart - Compiler
    • None

    Description

      PROBLEM

      The example below results in a Dart analyzer error since the reference to b.Foo is ambiguous in the generated code.

      FIX

      Name imports for dependencies to make references explicit.

      EXAMPLE

      thrift -r --gen dart a.thrift

      a.thrift

      include "b.thrift"
      
      namespace dart a
      
      /**@ Foo in a*/
      struct Foo {
      	1:string name
      }
      
      /**@ Bar in a*/
      struct Bar {
      	1:Foo aFoo,
      	2:b.Foo bFoo
      }
      

      b.thrift

      namespace dart b
      
      /**@ Foo in b*/
      struct Foo {
      	1:string name
      }
      

      Attachments

        Activity

          People

            markerickson-wk Mark Erickson
            markerickson-wk Mark Erickson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: