Modify

Opened 2 years ago

Last modified 2 years ago

#3924 assigned Bug

Run-time error calling MyByRefFunc($map["foo"].bar) ==> Expected a variable in user function call

Reported by: nurupo Owned by: Jon
Milestone: Component: AutoIt
Version: 3.3.16.1 Severity: None
Keywords: Cc:

Description

The following causes a run-time error:

Global $map[], $submap[]
$submap.bar = 0
$map["foo"] = $submap
foo($map["foo"].bar) ; ==> Expected a variable in user function call.:

Func foo(ByRef $var)
EndFunc

You have to use [] and then dot notation to reproduce the error. [] and [] works and doesn't result in error.

Using a dot notation and then [] also results in the error, i.e.:

foo($map.foo["bar"])

This seems to be an issue of operator precedence, as putting () to force the left-most element to get extracted first doesn't result in any run-time error, i.e.:

foo(($map["foo"]).bar)

and

foo(($map.foo)["bar"])

respectably.

(Note that declaring the function before it is used results in an AU3Check instead, not a run-time error, which supposedly was fixed in 3.3.16.1 but I'm still experiencing it: https://www.autoitscript.com/trac/autoit/ticket/3902#comment:3)

Attachments (0)

Change History (6)

comment:1 Changed 2 years ago by Jos

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

See https://www.autoitscript.com/trac/autoit/ticket/3902#comment:4

You could use the current Alpha version I posted here till either a new Beta or Prod version of AutoIt3 is published: https://www.autoitscript.com/autoit3/scite/download/beta_SciTE4AutoIt3/Au3Check.exe

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

comment:2 Changed 2 years ago by Jos

  • Milestone set to Future Release

comment:3 follow-up: Changed 2 years ago by nurupo

I'm a bit confused with your reply. You have linked to the Au3Check.exe, but this is a run-time issue, the application runs and then crashes after encountering this issue, it's not the Au3Check.exe linter issue. The one in 3902 is the linter issue, but not this one.

comment:4 in reply to: ↑ 3 Changed 2 years ago by Jos

  • Resolution Fixed deleted
  • Status changed from closed to reopened

Replying to nurupo:

I'm a bit confused with your reply. You have linked to the Au3Check.exe, but this is a run-time issue, the application runs and then crashes after encountering this issue, it's not the Au3Check.exe linter issue. The one in 3902 is the linter issue, but not this one.

Ah yes, you are right ... sorry about that and will correct my answer.

comment:5 Changed 2 years ago by Jos

  • Milestone Future Release deleted

comment:6 Changed 2 years ago by Jpm

  • Owner set to Jon
  • Status changed from reopened to assigned

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 assigned The owner will remain Jon.
Author


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

 
Note: See TracTickets for help on using tickets.