Skip to content

Invalid Dart code generated for union types #8986

@gudvinr

Description

@gudvinr

Compile following two files:

ext.fbs
// ext.fbs
namespace test.ext;

table Something {
    field: string;
}
test.fbs
// test.fbs
include "ext.fbs";

namespace test;

union TestUnion {
	ext.Something,
}

table Test {
	tu: TestUnion;
}

root_type Test;
$ flatc --dart -I ./ -o ./ ext.fbs test.fbs

flatc will generate this:

Image

Something here is the type from ext.fbs and dart fails on highlighted string with undefined_identifier:

Undefined name 'Something'.
Try correcting the name to one that is defined, or defining the name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions