Opened on Jul 26, 2022 at 2:19:18 PM
Closed on Jul 26, 2022 at 6:00:35 PM
Last modified on Oct 20, 2022 at 7:56:25 AM
#3902 closed Bug (Fixed)
Au3Check, Byref, Map.element
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Component: | Au3Check |
| Version: | Other | Severity: | None |
| Keywords: | 3.3.16.1-rc2 | Cc: |
Description
; Error: ; - Function with ByRef defined BEFORE usage ; - .element syntax used ;~ #cs Global $Map[] Func AddOne(ByRef $a) $a += 1 EndFunc $Map.something = 123 ConsoleWrite($Map.something & @CRLF) AddOne($Map.something) ConsoleWrite($Map.something & @CRLF) ;~ #ce ; Error Solution 01: ; - Function with ByRef defined AFTER usage ; - .element syntax used #cs Global $Map[] $Map.something = 123 ConsoleWrite($Map.something & @CRLF) AddOne($Map.something) ConsoleWrite($Map.something & @CRLF) Func AddOne(ByRef $a) $a += 1 EndFunc #ce ; Error Solution 02: ; - Function with ByRef defined BEFORE usage ; - ['element'] syntax used #cs Global $Map[] Func AddOne(ByRef $a) $a += 1 EndFunc $Map.something = 123 ConsoleWrite($Map.something & @CRLF) AddOne($Map['something']) ConsoleWrite($Map.something & @CRLF) #ce
The shown code will result in a "AddOne() called with Const or expression on ByRef-param(s)" error. The two other arrangements of the same code will not result in this error, and if you disable Au3Check entirely, the code will run fine. So its an Au3Check-only problem, AutoIt itself is fine with it.
Attachments (0)
Change History (4)
comment:1 by , on Jul 26, 2022 at 6:00:35 PM
| Resolution: | → Fixed |
|---|---|
| Status: | new → closed |
follow-up: 4 comment:3 by , on Oct 19, 2022 at 11:44:55 PM
Fixed by revision [12847] in version: 3.3.16.1
I have 3.3.16.1 installed and this is not fixed, AU3Check still errors:
Func foo(ByRef $bar) EndFunc ; Works Global $map1[] $map1["test"] = 0 foo($map1["test"]) ; Errors Global $map2[] $map2.test = 0 foo($map2.test) ; <-- error: foo() called with Const or expression on ByRef-param(s).
Did the fix not make it into 3.3.16.1 for some reason? It's also not mentioned in the changelog.
comment:4 by , on Oct 20, 2022 at 7:51:16 AM
Replying to nurupo <nurupo.contributions@…>:
Fixed by revision [12847] in version: 3.3.16.1
Did the fix not make it into 3.3.16.1 for some reason? It's also not mentioned in the changelog.
Correct... that TAG is wrong and the fix will be in the next Beta/Prod versions as 3.3.16.1 is just a fix release for some AutoIt3 issues
comment:5 by , on Oct 20, 2022 at 7:56:25 AM
| Milestone: | → Future Release |
|---|

Fixed by revision [12845]