Modify

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#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 Changed 2 years ago by Jos

  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [12845]

comment:3 follow-up: Changed 2 years ago by nurupo <nurupo.contributions@…>

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 in reply to: ↑ 3 Changed 2 years ago by Jos

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

Version 0, edited 2 years ago by Jos (next)

comment:5 Changed 2 years ago by Jos

  • Milestone set to Future Release

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.