edgedb icon indicating copy to clipboard operation
edgedb copied to clipboard

Custom type in function variadic argument is not found in migration

Open fantix opened this issue 3 years ago • 0 comments

  • EdgeDB Version: 2.0+88c1706, 2.1+52c90a7

This fails:

edgedb> start migration to {
.......     module default {
.......         scalar type E extending enum<a, b, c>;
.......         function f(variadic e: E) -> bool using (true);
.......     }
....... };
OK: START MIGRATION
edgedb[tx]> populate migration;
OK: POPULATE MIGRATION
edgedb[tx]> commit migration;
edgedb error: InvalidReferenceError: type 'default::E' does not exist

But doing it separately succeeds:

edgedb> start migration to {
.......     module default {
.......         scalar type E extending enum<a, b, c>;
.......
.......     }
....... };
OK: START MIGRATION
edgedb[tx]> populate migration;
OK: POPULATE MIGRATION
edgedb[tx]> commit migration;
OK: COMMIT MIGRATION
edgedb> start migration to {
.......     module default {
.......         scalar type E extending enum<a, b, c>;
.......         function f(variadic e: E) -> bool using (true);
.......     }
....... };
OK: START MIGRATION
edgedb[tx]> populate migration;
OK: POPULATE MIGRATION
edgedb[tx]> commit migration;
OK: COMMIT MIGRATION
edgedb> \ds
module default {
    function f(variadic e: default::E) ->  std::bool using (true);
    scalar type E extending enum<a, b, c>;
};

fantix avatar Aug 05 '22 16:08 fantix