Process longId for SynTypeDefnKind.Augmentation. #15897
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A problem with
--test:GraphBasedChecking
was found by @TheAngryByrd in https://github.com/TheAngryByrd/IcedTasks/tree/graph-based-playground-1A link between files was not detected for type extensions. Thus this leads to a consistent compiler error.
The fix of this PR was in the untyped AST processing we do to detect links between the identifiers found in a file and the project Trie. This wasn't overly complicated to fix and I'd like to write down what my methodology was.
First up, I cloned the branch and scrapped the compiler arguments for the project that was failing.
I used telplin for this, but I could have used the scrape.fsx file. In both cases, a build of the project happens and the
binlog
is processed to extract the compiler arguments ofCoreCompile
. (Yes, a design-time build would be the more clever thing to do, but let's not get carried away).Having the compiler arguments or response file (
*.rsp
) can be used to debug the actual project infsharp/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/CompilationFromCmdlineArgsTests.fs
Lines 55 to 58 in 97a5b65
Running that sufficed, as it was clear that the problem still existed on the main branch.
The compiler error was pretty clear that a type was not known during the checking of a type extension.
So, I extracted a sample from the real project into a scenario:
Mimicking the problem, this was a lot easier to debug of course to see what was happening in
FileContentMapping.fs
.Both
tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/DependencyResolutionTests.fs
and/tests/FSharp.Compiler.ComponentTests/TypeChecks/Graph/CompilationTests.fs
were failing for the newly added scenario.It soon became obvious that
PoolingValueTasks.PoolingValueTaskBuilderBase
should be processed as well because the combined linkIceTasks.PoolingValueTasks.PoolingValueTaskBuilderBase
does link a module in the Trie and thus introduces the link between the files.Afterwards, I added another test for signature files. There the AST is surprisingly different for type extensions compared to implementation files. I'm not sure if that is by design or a bit of a gap.
Anyway, this is ready for review.