Compiler throws an incorrect/not-useful error for more arguments used in BIF on the component file

Description

I have a cfc I am working on and doing tests. At one point I added the same method twice by accident. Lucee reports this with the following exception:

Which makes it really impossible to figure out the issue. I had to start up an Adobe server to get the error

 

If not, It would have been impossible to figure it out.

Environment

mac os

Activity

Pothys - MitrahSoft 
15 July 2022 at 13:17

Stacktrace from 5.3.10.28-SNAPSHOT

Pothys - MitrahSoft 
23 May 2022 at 11:06
(edited)

I've checked this ticket and confirmed the issue happened on lucee latest version 5.3.10.10-SNAPSHOT. If we use component with the same line of ( { ) and extra argument on a BIF call (fileReadAsBinary( path, "UTF-8" )) means lucee throws an correct error.

But If we use component with the next line of ( { ) and extra argument on a BIF call (fileReadAsBinary( path, "UTF-8" )) means lucee throws an error like lucee.transformer.bytecode.statement.ExpressionAsStatement cannot be cast to lucee.transformer.bytecode.statement.tag.TagComponent and it didn’t throws the error occured line.


Seems ACF throws correct error in both cases.

Luis Majano 
20 May 2022 at 14:54

It was not the repeated function. Actually, Lucee ignores the repeated functions and Adobe does not. HOwever, that’s another issue. The issue was an extra argument to a CFML Function call, see comment below to recreate.

Luis Majano 
20 May 2022 at 14:53

Ok, it was not the repeat function, it was an extra argument to an internal CFML function call

  1. An extra argument on a function call. I had this fileReadAsBinary( path, "UTF-8" ) However, fileReasAsBinary( path ) only takes in 1 argument.

Adobe reports the issues correctly.

Pothys - MitrahSoft 
20 May 2022 at 09:47

Multiple functions with same name is works in lucee(. So it's doesn't real cause to this issue.

maybe the invalid syntax in component (( causes to this. But ACF shows the error message for multiple function in same name, not a syntax error.

So, As mentioned the testcode would help to find the exact cause of this issue.

Details

Assignee

Reporter

Priority

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 19 May 2022 at 17:07
Updated 8 June 2023 at 20:05