From 17d687b6a2ea510759d798a03bb80c507ade573e Mon Sep 17 00:00:00 2001 From: Leedehai <18319900+Leedehai@users.noreply.github.com> Date: Sun, 11 Feb 2024 08:08:43 -0500 Subject: Better errors for array/dictionary method calls that return mutable (#3370) --- tests/typ/compiler/array.typ | 2 +- tests/typ/compiler/dict.typ | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'tests/typ/compiler') diff --git a/tests/typ/compiler/array.typ b/tests/typ/compiler/array.typ index 67b8abc3..9ff29480 100644 --- a/tests/typ/compiler/array.typ +++ b/tests/typ/compiler/array.typ @@ -54,7 +54,7 @@ // Test lvalue out of bounds. #{ let array = (1, 2, 3) - // Error: 3-14 array index out of bounds (index: 3, len: 3) and no default value was specified + // Error: 3-14 array index out of bounds (index: 3, len: 3) array.at(3) = 5 } diff --git a/tests/typ/compiler/dict.typ b/tests/typ/compiler/dict.typ index 92cacdb3..eca1c458 100644 --- a/tests/typ/compiler/dict.typ +++ b/tests/typ/compiler/dict.typ @@ -66,7 +66,8 @@ // Missing lvalue is not automatically none-initialized. #{ let dict = (:) - // Error: 3-9 dictionary does not contain key "b" and no default value was specified + // Error: 3-9 dictionary does not contain key "b" + // Hint: 3-9 use `insert` to add or update values dict.b += 1 } -- cgit v1.2.3