Skip to content

Help wanted: how to run ExprTests in CompilerService, keep getting The exception has been reported. This internal exception should now be caught at an error recovery point on the stack. Original message: Exception of type 'FSharp.Compiler.ErrorLogger+UnresolvedPathReferenceNoRange' was thrown.) #9617

Closed
@abelbraaksma

Description

@abelbraaksma

Blocks: #9549

I've tried several ways to run these tests. From the commandline, I believe they're part of the FSharpQA tests, and they crash, plus the failing tests just say "failed". When running them from the Tests window in VS, I found that they all fail in GetOptimizedAssemblyContents() with the error:

The exception has been reported. This internal exception should now be caught at an error recovery point on the stack. Original message: Exception of type 'FSharp.Compiler.ErrorLogger+UnresolvedPathReferenceNoRange' was thrown.)

I don't understand this error...

Repro steps

Use this PR: #9549. Then:

Rebuild All -> Run test "Test Operator Declarations for Byte" (or any other test in that file).

The error does not occur if I use a master branch, I assume that's because the generated IL is different. But instead of getting an error on the expected output, I get the error shown above.

Expected behavior

That there's at least one way of running these tests properly, and seeing output on what fails and why. CI raises the same exception, see for instance this log dump: https://dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_apis/build/builds/715859/logs/117 (search for FSharp.Compiler.ErrorLogger+ReportedError).

Actual behavior

The following line (bottom) always seems to balk at me:

let args = mkProjectCommandLineArgsSilent (dllName, [fileName])
let options = checker.GetProjectOptionsFromCommandLineArgs (projFileName, args)
let wholeProjectResults = exprChecker.ParseAndCheckProject(options) |> Async.RunSynchronously
for e in wholeProjectResults.Errors do
printfn "%s Operator Tests error: <<<%s>>>" dnName e.Message
wholeProjectResults.Errors.Length |> shouldEqual 0
let fileUnoptimized = wholeProjectResults.AssemblyContents.ImplementationFiles.[0]
let fileOptimized = wholeProjectResults.GetOptimizedAssemblyContents().ImplementationFiles.[0]

Known workarounds

Not yet...

Related information

I also notice that more often than not, Visual Studio keeps a lock on DummyProviderForLanguageServiceTesting.dll, which makes debug-fix-rebuild impossible (closing VS doesn't always help here...). This sounds like there needs to be a try-finally added somewhere.

Running the tests through Ctrl+F5 in a new VS 2019 instance leads to the same error.

I think this function and tests were introduced here: #3784, @forki, do you know why I keep getting the UnresolvedPathReferenceNoRange and what to do about it? It sounds like some reference is not what is expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions