From c5c73ec9315b8148e851693ffa279c75a97982d3 Mon Sep 17 00:00:00 2001 From: Malo <57839069+MDLC01@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:20:05 +0200 Subject: Fix compiler panic on stack with infinite spacing (#3918) --- tests/suite/layout/grid/grid.typ | 9 +++++++++ tests/suite/layout/stack.typ | 9 +++++++++ 2 files changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/suite/layout/grid/grid.typ b/tests/suite/layout/grid/grid.typ index f4f0b90a..2d45095d 100644 --- a/tests/suite/layout/grid/grid.typ +++ b/tests/suite/layout/grid/grid.typ @@ -274,3 +274,12 @@ The following: [], [a] ) + +--- issue-3917-grid-with-infinite-width --- +// https://github.com/typst/typst/issues/1918 +#set page(width: auto) +#context layout(available => { + let infinite-length = available.width + // Error: 3-50 cannot create grid with infinite width + grid(gutter: infinite-length, columns: 2)[A][B] +}) diff --git a/tests/suite/layout/stack.typ b/tests/suite/layout/stack.typ index 1eca52c9..aad273a5 100644 --- a/tests/suite/layout/stack.typ +++ b/tests/suite/layout/stack.typ @@ -80,3 +80,12 @@ World! 🌍 stack([a], 1fr, [b]), stack([a], v(1fr), [b]), ) + +--- issue-1918-stack-with-infinite-spacing --- +// https://github.com/typst/typst/issues/1918 +#set page(width: auto) +#context layout(available => { + let infinite-length = available.width + // Error: 3-40 stack spacing is infinite + stack(spacing: infinite-length)[A][B] +}) -- cgit v1.2.3