Incomprehensible error XS9999

This forum is meant for questions and discussions about the X# language and tools
Post Reply
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Incomprehensible error XS9999

Post 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
Best regards,
Leonid
User avatar
Chris
Posts: 4907
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Incomprehensible error XS9999

Post 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?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Incomprehensible error XS9999

Post 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
Best regards,
Leonid
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Incomprehensible error XS9999

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Incomprehensible error XS9999

Post 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
Best regards,
Leonid
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Incomprehensible error XS9999

Post by robert »

Leonid,

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

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
Chris
Posts: 4907
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Incomprehensible error XS9999

Post 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.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Incomprehensible error XS9999

Post by leon-ts »

Robert,

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

Best regards,
Leonid
Attachments
TestConsoleApplication.zip
(197.93 KiB) Downloaded 63 times
Best regards,
Leonid
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Incomprehensible error XS9999

Post 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
XSharp Development Team
The Netherlands
robert@xsharp.eu
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Incomprehensible error XS9999

Post by leon-ts »

Robert,

Many thanks!

Best regards,
Leonid
Best regards,
Leonid
Post Reply