edgedb-js icon indicating copy to clipboard operation
edgedb-js copied to clipboard

Type instantiation is excessively deep and possibly infinite

Open ClaudiuCeia opened this issue 2 years ago • 3 comments

  • EdgeDB Version: 4.0+d568f08
  • EdgeDB CLI Version: EdgeDB CLI 4.0.2+be1da73
  • OS Version: Linux 6.5.6-200.fc38.x86_64 (Fedora 38)
  • Deno Version: deno 1.38.0 (release, x86_64-unknown-linux-gnu)
  • Typescript Version: typescript 5.2.2

Steps to Reproduce:

  1. Try the documented tuple assignment using Deno:
const spidey = e.tuple({
  name: e.str("Peter Parker"),
  age: e.int64(18)
});
  1. Observe Type instantiation is excessively deep and possibly infinite error:
Type instantiation is excessively deep and possibly infinite.deno-ts(2589)
(property) tuple: <{
    name: $expr_Literal<ScalarType<"std::str", string, string, "Peter Parker">>;
    age: $expr_Literal<ScalarType<"std::number", number, number, 18>>;
}>(shape: {
    ...;
}) => $expr_NamedTuple<...> (+3 overloads)

Schema:

Not applicable, error reproducible for literal named tuple instantiation


Cheers, thanks for your hard work, EdgeDB is awesome so far!

ClaudiuCeia avatar Nov 14 '23 19:11 ClaudiuCeia

Very curious that it does not seem to have the same issue with non-Deno TypeScript, even with the same version of TypeScript.

scotttrinh avatar Nov 15 '23 14:11 scotttrinh

A recurrent theme unfortunately. I guess edgeql-js pushes the boundaries just enough to hit some limitations of the way tsc is integrated into Deno. The weird thing is, I've tried again now with multiple tuple options, including empty tuples and those didn't trigger the error (as expected). But I'm also no longer able to reproduce so I'm wondering if this is maybe related to the way Deno does incremental compilation which they hint at in the docs.

ClaudiuCeia avatar Nov 15 '23 22:11 ClaudiuCeia

Scrap that - seems to be happening again, not sure what's going on or how I can get it working again.

ClaudiuCeia avatar Nov 17 '23 21:11 ClaudiuCeia

I see this when I upgrade to Typescript 5.4. Rolling back to 5.3 fixes it

corbinu avatar Mar 07 '24 15:03 corbinu

Fixed in 1.5.x

scotttrinh avatar Apr 15 '24 16:04 scotttrinh