Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading error message on CLIPPER/STRICT overload #1419

Open
cpyrgas opened this issue Jan 23, 2024 · 0 comments
Open

Misleading error message on CLIPPER/STRICT overload #1419

cpyrgas opened this issue Jan 23, 2024 · 0 comments

Comments

@cpyrgas
Copy link

cpyrgas commented Jan 23, 2024

https://www.xsharp.eu/forum/topic?p=28449#p28449

CLASS TestClass
	METHOD Test() AS LOGIC // with /vo5 enabled or with explicit CLIPPER clause
	RETURN FALSE
	METHOD Test(n AS INT) AS VOID
END CLASS

Above produces error message error XS0111: Type 'TestClass' already defines a member called 'Test' with the same parameter types

But the message is misleading, the parameter types are not the same, the error should point out that a method cannot have a CLIPPER and a STRICT overload. I think I remember that in the past indeed such a more informative error was reported, but I am not sure.

Also the error is reported only when the STRICT method has a single parameter. When there are more than one, then there is no error reported at all:

// no compiler error
CLASS TestClass
	METHOD Test() AS LOGIC CLIPPER
	RETURN FALSE
	METHOD Test(n AS INT, c AS STRING) AS VOID STRICT
END CLASS

Shouldn't there be a compiler error reported also in this case because of the CLIPPER/STRICT overloading?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant