Skip to content

Commit

Permalink
Fix a weird computable/alias interaction (#3828)
Browse files Browse the repository at this point in the history
  • Loading branch information
msullivan committed May 9, 2022
1 parent a5310df commit d90652f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion edb/edgeql/compiler/setgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ def _is_computable_ptr(
return qlexpr is not None

return (
ptrcls.is_pure_computable(ctx.env.schema)
bool(ptrcls.get_expr(ctx.env.schema))
or is_injected_computable_ptr(ptrcls, ctx=ctx)
)

Expand Down
8 changes: 8 additions & 0 deletions tests/test_edgeql_ddl.py
Original file line number Diff line number Diff line change
Expand Up @@ -13090,6 +13090,14 @@ async def test_edgeql_ddl_no_type_intro_in_default(self):
};
""")

async def test_edgeql_ddl_computed_and_alias(self):
await self.con.execute(r"""
create type Tgt;
create type X { create link foo -> Tgt };
create alias Y := X { foo: {id} };
alter type X { create link bar := .foo };
""")


class TestConsecutiveMigrations(tb.DDLTestCase):
TRANSACTION_ISOLATION = False
Expand Down

0 comments on commit d90652f

Please sign in to comment.