Unexpected behaviour with dot-pathed final static struct

Description

Repro:

// C.cfc component { static { final static.usingLiteral = { subKey = "value" } final static.usingDots.subKey = "value" } }
<!--- test.cfm---> <cfscript> writeDump(C::usingLiteral) writeDump(C::usingDots) </cfscript>

Result:

Expected:

Both dumps to be the same.

NB: this only happens if the variable is final.

Confirmed on 6.0.0.416-SNAPSHOT and 5.3.10.97 (and 5.4.0.65-RC-light-nginx).

Both in docker containers (perhaps relevant, as I’ve had other issues with static / final in Docker containers that aren’t reproduceable in a native install).

The Docker container set-up I use is @ https://github.com/adamcameron/lucee6_and_mariadb & https://github.com/adamcameron/lucee_and_mariadb

Environment

None

Attachments

1
  • 07 Jun 2023, 01:44 pm

Activity

Show:

Michael Offner 30 April 2024 at 11:49

good finding, was not easy to fix winking face

Pothys - MitrahSoft 16 October 2023 at 15:10

I added a testcase for this issue : https://github.com/lucee/Lucee/pull/2260 (5.4) [disabled].

Pothys - MitrahSoft 8 June 2023 at 07:48

I checked this issue with the code mentioned above on the lucee version 6.0.0.434-SNAPSHOT. When I used dot-operator struct with final static .It returns java class and ACF throws the "Cannot assign final to variable prefixed with struct" error.

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 7 June 2023 at 13:44
Updated 1 May 2024 at 07:32
Resolved 1 May 2024 at 07:32

Flag notifications