diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-08-12 13:39:33 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-08-12 13:56:23 +0200 |
| commit | eaa3cbaa9c2b1564a4b0db013672245a1893314a (patch) | |
| tree | 616a3d0f3686793caffcef72f230f8ba79b8f3ca /tests/typ/code/ops-invalid.typ | |
| parent | 8207c31aec6336b773fbf4661fdb87625c8b584e (diff) | |
Array and dictionary indexing
Diffstat (limited to 'tests/typ/code/ops-invalid.typ')
| -rw-r--r-- | tests/typ/code/ops-invalid.typ | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/typ/code/ops-invalid.typ b/tests/typ/code/ops-invalid.typ index 5e56ff98..e1662ddd 100644 --- a/tests/typ/code/ops-invalid.typ +++ b/tests/typ/code/ops-invalid.typ @@ -47,6 +47,20 @@ {3 / 12pt} --- +// Error: 2-9 cannot repeat this string -1 times +{-1 * ""} + +--- +{ + let x = 2 + for _ in 0..60 { + x *= 2 + } + // Error: 4-18 cannot repeat this string 4611686018427387904 times + {x * "abcdefgh"} +} + +--- // Error: 14-22 cannot add integer and string { let x = 1; x += "2" } @@ -63,11 +77,11 @@ { 1 .. "" } --- -// Error: 3-6 cannot assign to this expression +// Error: 3-6 cannot access this expression mutably { (x) = "" } --- -// Error: 3-8 cannot assign to this expression +// Error: 3-8 cannot access this expression mutably { 1 + 2 += 3 } --- @@ -75,7 +89,7 @@ { z = 1 } --- -// Error: 3-7 cannot assign to a constant +// Error: 3-7 cannot mutate a constant { rect = "hi" } --- |
