Modify

Opened 2 months ago

Closed 2 months ago

Last modified 7 weeks ago

#3902 closed Bug (Fixed)

Au3Check, Byref, Map.element

Reported by: anonymous Owned by: Jpm
Milestone: 3.3.16.1 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 (2)

comment:1 Changed 2 months ago by Jos

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

Fixed by revision [12845]

comment:2 Changed 7 weeks ago by Jpm

  • Milestone set to 3.3.16.1
  • Owner set to Jpm

Fixed by revision [12847] in version: 3.3.16.1

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 owner will remain Jpm.
Author


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

 
Note: See TracTickets for help on using tickets.