All work
- Property Default Values Type InconsistencyLDEV-5547
- Cannot declare a property with the name "firstName" using the compact cfscript syntaxLDEV-2929Resolved issue: LDEV-2929Michael Offner
- Regression: Property shorthand in script components brokenLDEV-2874Resolved issue: LDEV-2874Michael Offner
- Bug with the word "beanFactory" like name of propertyLDEV-2826Resolved issue: LDEV-2826Michael Offner
- Short-hand component properties parsed incorrectly - regression from 5.3.3LDEV-2748Resolved issue: LDEV-2748Michael Offner
- Regression: In Lucee 5.3.3, component Property function does not recognize variables defined at the top of that ComponentLDEV-2645Resolved issue: LDEV-2645Michael Offner
- Implicit Accessors Do Not Respect TypesLDEV-1560Resolved issue: LDEV-1560Michael Offner
- use default value on cfproperty regardless of accessorsLDEV-929Resolved issue: LDEV-929Michael Offner
- Property validation should throw error for auto population of setterLDEV-816Resolved issue: LDEV-816Michael Offner
- cfproperty default attribute should preserve types and support complex typesLDEV-801Resolved issue: LDEV-801Michael Offner
- Short-hand syntax should work for property as per paramLDEV-48
11 of 11
Property Default Values Type Inconsistency
Description
Environment
None
relates to
Details
Details
Assignee
Unassigned
UnassignedReporter
Michael Offner
Michael OffnerPriority
Labels
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
Sprint
Created 28 April 2025 at 18:46
Updated 28 April 2025 at 19:02
Default values for component properties are inconsistently typed depending on whether they are defined as literals or as evaluated expressions.
When defining property default values in CFC components, the Lucee compiler currently handles the typing differently based on how the default value is provided:
When using literals directly, the compiler converts all values to strings regardless of the specified property type:
When using pound signs to evaluate the expressions, the values are correctly typed according to the property type:
Expected Behavior
Both approaches should result in the same behavior. The compiler should respect the specified property type (
numeric
,boolean
, etc.) and cast the default values accordingly, regardless of whether they are provided as literals or as evaluated expressions.Current Behavior
When using literals, all default values are treated as strings, ignoring the specified property type. When using evaluated expressions with pound signs, the values are correctly typed.
Steps to Reproduce
Create a CFC with properties defined using both approaches
Inspect the property values at runtime
Observe that without pound signs (
#
), numeric and boolean properties have string values instead of their proper typesRelated Issues
This issue was discovered while investigating another bug related to the import functionality.
Additional Notes
The compiler should handle both syntaxes consistently, treating default values according to their specified property types rather than converting literals to strings.