xsharp.eu • Incomprehensible error XS9999
Page 1 of 1

Incomprehensible error XS9999

Posted: Tue Aug 25, 2020 10:22 am
by leon-ts
Hi,

At the end of the compilation of the project, an incomprehensible error occurred:

Code: Select all

Error XS9999 An internal compiler error has occurred: 'Unexpected value 'Worst' of type 'LanguageService.CodeAnalysis.XSharp.MemberResolutionKind'',    at LanguageService.CodeAnalysis.XSharp.OverloadResolutionResult`1.ReportDiagnostics[T](Binder binder, Location location, SyntaxNode nodeOpt, DiagnosticBag diagnostics, String name, BoundExpression receiver, SyntaxNode invokedExpression, AnalyzedArguments arguments, ImmutableArray`1 memberGroup, NamedTypeSymbol typeContainingConstructor, NamedTypeSymbol delegateTypeBeingInvoked, XSharpSyntaxNode queryClause, Boolean isMethodGroupConversion, Nullable`1 returnRefKind, TypeSymbol delegateType) in C:XSharpDevRoslynSrcCompilersCSharpPortableBinderSemanticsOverloadResolutionOverloadResolutionResult.cs:line 210
Help is needed. Where to find it in the project?

Best regards,
Leonid

Incomprehensible error XS9999

Posted: Tue Aug 25, 2020 10:24 am
by Chris
Hi Leonid,

This means there's a problem in the compiler unfortunately, causing itself to crash. Can you send us the the project so we can find what's causing it?

Incomprehensible error XS9999

Posted: Tue Aug 25, 2020 10:29 am
by leon-ts
Hi Chris,

Unfortunately, I cannot transfer the real project to third parties. This is prohibited by the policy of the company I work for. This is a large project and it uses other projects (reference) that are included in the solution (81MB). I would make a separate example, but I don’t even understand where the error is in the project.

Best regards,
Leonid

Incomprehensible error XS9999

Posted: Tue Aug 25, 2020 10:57 am
by robert
Leonid,
This happens when the compiler tries to decide which of two or more overloads of a method to choose.
For some reason this should return at least one option with the value "Best" but in this case it apparently returns only "Worst" values.
So if you want to look you need to look for methods or functions that are overloaded.
Maybe you are calling one of these with a value of type Usual ?

Robert

Incomprehensible error XS9999

Posted: Tue Aug 25, 2020 12:17 pm
by leon-ts
Robert,

Thank you very much for the information!

I found the problematic method. It is hosted in another project (library) that is linked to the project generating the compilation error. The problem is really with method overloading and type parameter PARAMS.

I took the problem out into a separate example:

Code: Select all

FUNCTION Start() AS VOID STRICT
	Test.Exec("MyFunc", 1)
	RETURN
	
PUBLIC STATIC CLASS Test

	PUBLIC STATIC METHOD Exec(cName AS STRING, uReturnValue OUT USUAL, aParameters PARAMS OBJECT[]) AS LOGIC
		uReturnValue := NIL
		RETURN FALSE

	PUBLIC STATIC METHOD Exec(cName AS STRING, aParameters PARAMS OBJECT[]) AS USUAL
		RETURN NIL

END CLASS
Best regards,
Leonid

Incomprehensible error XS9999

Posted: Tue Aug 25, 2020 12:23 pm
by robert
Leonid,

When I compile this example code with 2.5b then I get no compiler errors...

Robert

Incomprehensible error XS9999

Posted: Tue Aug 25, 2020 12:26 pm
by Chris
Robert,

Actually I do gt the error Leonid reported. I will add it to the test suite you can reproduce it as well.

Edit: Done, in order to reproduce the problem, /vo7+ must be enabled.

Incomprehensible error XS9999

Posted: Tue Aug 25, 2020 12:31 pm
by leon-ts
Robert,

In the attachment is my test project where I reproduced this error.

Best regards,
Leonid

Incomprehensible error XS9999

Posted: Tue Aug 25, 2020 12:47 pm
by robert
Leonid,
This is related to the /vo7 compiler option. If you disable this (or use a pragma to disable it) then it works:

Code: Select all

#pragma options ("vo7", off)
FUNCTION Start() AS VOID STRICT
	Test.Exec("MyFunc", 1)
	RETURN
#pragma options ("vo7", default)	
Robert

Incomprehensible error XS9999

Posted: Tue Aug 25, 2020 1:10 pm
by leon-ts
Robert,

Many thanks!

Best regards,
Leonid