From fe70048b33baebdfbf7071059bd4742ec16ab408 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 15:17:31 +0000 Subject: fix(classes): defer NEW for DECLARE without a parameterless constructor A plain DECLARE, field or array element now calls NEW only when the class has a parameterless one; otherwise the zeroed object waits for x <- NEW C(...), as in guide section 10.2. DECLARE with parentheses still requires a matching constructor. Co-Authored-By: Claude Sonnet 5.5 --- tests/iii/class-constructor-default-errors/case.json | 12 ------------ tests/iii/class-overload-errors/case.json | 4 ---- 2 files changed, 16 deletions(-) (limited to 'tests') diff --git a/tests/iii/class-constructor-default-errors/case.json b/tests/iii/class-constructor-default-errors/case.json index adcefe8..7527470 100644 --- a/tests/iii/class-constructor-default-errors/case.json +++ b/tests/iii/class-constructor-default-errors/case.json @@ -1,9 +1,5 @@ { "errors": [ - { - "reason": "Incorrect # arguments passed to Required.NEW", - "line": 15 - }, { "reason": "Incorrect # arguments passed to Required.NEW", "line": 16 @@ -16,14 +12,6 @@ "reason": "Cannot access private method NEW", "line": 18 }, - { - "reason": "Incorrect # arguments passed to Required.NEW", - "line": 19 - }, - { - "reason": "Incorrect # arguments passed to Required.NEW", - "line": 20 - }, { "reason": "Constructor arguments require a class type", "line": 21 diff --git a/tests/iii/class-overload-errors/case.json b/tests/iii/class-overload-errors/case.json index afc0e6a..ea103c0 100644 --- a/tests/iii/class-overload-errors/case.json +++ b/tests/iii/class-overload-errors/case.json @@ -4,10 +4,6 @@ "reason": "Duplicate member Set in class Mixed", "line": 4 }, - { - "reason": "No matching overload for Required.NEW\\(\\)", - "line": 17 - }, { "reason": "Cannot access private method Set of type Secret", "line": 19 -- cgit v1.3.1-4-g156e