Modify

Opened 12 years ago

Closed 12 years ago

#2518 closed Bug (Fixed)

Static evaluates incorrect

Reported by: Taz77 <autoit@…> Owned by: Jon
Milestone: 3.3.9.23 Component: AutoIt
Version: 3.3.9.21 Severity: None
Keywords: static Cc:

Description

Func _Test()
	Return 7
EndFunc

Func _MyFirstFunc()
	Local Static $Test = _Test(), $FuncName = 'Dummy One'

	ConsoleWrite('FuncName is: ' & $FuncName & @CRLF)
EndFunc

Func _MySecendFunc()
	Local Static $Test = _Test(), $FuncName = 'Dummy Two'

	ConsoleWrite('FuncName is: ' & $FuncName & @CRLF)
EndFunc

_MyFirstFunc()
_MySecendFunc()

outputs:

FuncName is: Dummy One
FuncName is: Dummy One

properly it would be:

FuncName is: Dummy One
FuncName is: Dummy Two

Forum Link

Attachments (0)

Change History (5)

comment:1 by J-Paul Mesnage, 12 years ago

Resolution: Duplicate
Status: newclosed

Already fixed in 3.3.9.22

in reply to:  1 comment:2 by Taz77 <autoit@…>, 12 years ago

Replying to Jpm:

Already fixed in 3.3.9.22


is NOT fixed in 3.3.9.22 Forum Link

Func _Test()
	Return 7
EndFunc

Func _Func_A()
	Local Static $Test = _Test(), $String = 'This is a string.'
	ConsoleWrite('_Func_A() string is: ' & $String & @CRLF)
EndFunc

Func _Func_B()
	Local Static $Test = _Test(), $String = 'and this is another string.'
	ConsoleWrite('_Func_B() string is: ' & $String & @CRLF)
EndFunc

_Func_A()
_Func_B()

the output is:

_Func_A() string is: This is a string.
_Func_B() string is: This is a string.

but so it would be correct:

_Func_A() string is: This is a string.
_Func_B() string is: and this is another string.

comment:3 by J-Paul Mesnage, 12 years ago

Resolution: Duplicate
Status: closedreopened

I am sorry in my local dev environment (uppose to be in sync with the next beta)

it works fine, that's the reason I close it.

I ned now to find out why !!!

comment:4 by J-Paul Mesnage, 12 years ago

You will not believe the fix I proposed to Jon for #2372 is fixing this one too.
The only problem is Jon does not like it.
Wait and see

Last edited 12 years ago by J-Paul Mesnage (previous) (diff)

comment:5 by Jon, 12 years ago

Milestone: 3.3.9.23
Owner: set to Jon
Resolution: Fixed
Status: reopenedclosed

Fixed by revision [9179] in version: 3.3.9.23

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.