wrong line number for errors when casting return types

Description

<cffunction name="test" returntype="struct"> <cfreturn "this will throw a cast error, but at the wrong line line number"> </cffunction> <cftry> <cfscript> test(); // throws can't cast String [this will throw a cast error, but at the wrong line line number] to a value of type [struct] on line 7 // but the error occurred at the code on line 2 </cfscript> <Cfcatch> <cfoutput> <pre> #cfcatch.stacktrace# </pre> </cfoutput> <cfdump var=#cfcatch#> </Cfcatch> </cftry>
Lucee.runtime.exp.UDFCasterException: can't cast String [this will throw a cast error, but at the wrong line line number] to a value of type [struct] at lucee.runtime.type.UDFImpl._call(UDFImpl.java:381) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:226) at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:771) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:756) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1718) at testreturntypecasterror_cfm$cf.call(/testReturnTypeCastError.cfm:7)

Attachments

2
  • 27 Mar 2018, 12:47 am
  • 27 Mar 2018, 12:46 am

Activity

Show:

Details

Assignee

Reporter

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

Priority

Created 27 March 2018 at 00:48
Updated 27 March 2018 at 00:53

Flag notifications