Skip to content

Conversation

auduchinok
Copy link
Member

@auduchinok auduchinok commented Sep 2, 2025

Types of certain expressions and patterns are captured during analysis, so features like code completion could use them later. This PR adds APIs to get these types and also captures types of some additional expressions.

In comparison with working with typed tree, this approach allows getting types of various expressions even when the resulting expression could not be created due to errors in the source.

I'm planning to add more reporting in the subsequent PRs. It would also be nice to revive #8828.

Copy link
Contributor

github-actions bot commented Sep 2, 2025

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/10.0.100.md

@auduchinok
Copy link
Member Author

I'm stuck with the ILVerify tests due to #18289 again:

Eugene.Auduchinok@NVC00221 MINGW64 /c/Developer/fsharp (parser-testSource2)
$ ./tests/ILVerify/ilverify.ps1
./tests/ILVerify/ilverify.ps1: line 5: Write-Host: command not found
./tests/ILVerify/ilverify.ps1: line 7: syntax error near unexpected token `('
./tests/ILVerify/ilverify.ps1: line 7: `[string] $repo_path = (Get-Item -Path $PSScriptRoot).Parent.Parent'

Or when trying another shell, as suggested in the devguide:

PS C:\Developer\fsharp> $TEST_UPDATE_BSL=1
PS C:\Developer\fsharp> .\tests\ILVerify\ilverify.ps1
Checking whether running on Windows:
Repository path: fsharp
ILVerify version:
9.0.0-rtm.24528.9+9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3
Building Debug configuration...
& : The module 'fsharp' could not be loaded. For more information, run 'Import-Module fsharp'.
At C:\Developer\fsharp\tests\ILVerify\ilverify.ps1:44 char:11
+         & $script -c $configuration
+           ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (fsharp\build.sh:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoLoadModule

Building Release configuration...
& : The module 'fsharp' could not be loaded. For more information, run 'Import-Module fsharp'.
At C:\Developer\fsharp\tests\ILVerify\ilverify.ps1:44 char:11
+         & $script -c $configuration
+           ~~~~~~~
    + CategoryInfo          : ObjectNotFound: (fsharp\build.sh:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoLoadModule

Checking if dotnet-ilverify is installed...
 dotnet-ilverify is installed:
  dotnet-ilverify      9.0.2-servicing.25065.18      ilverify
Found the following runtimes:
 Microsoft.NETCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 8.0.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 9.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 9.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 10.0.0-preview.7.25380.108 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Selected runtime:
  Microsoft.NETCore.App 10.0.0-preview.7.25380.108 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Using the following path to runtime:
  C:\Program Files\dotnet\shared\Microsoft.NETCore.App/10.0.0-preview.7.25380.108
DLL not found: fsharp\artifacts\bin/FSharp.Core/Debug/netstandard2.0/FSharp.Core.dll

Could someone update the baselines here, please?

@T-Gro
Copy link
Member

T-Gro commented Sep 3, 2025

& : The module 'fsharp' could not be loaded. For more information, run 'Import-Module fsharp'.

I think the script is (badly) written in a way that relies on having a specific current directory, otherwise it searches in wrong folders
For the right shell, we could at least add a #!/usr/bin/env pwsh, you are right.

I will do it 👍 (I think those two things should make it smoother to execute)

@dotnet dotnet deleted a comment from github-actions bot Sep 3, 2025
@T-Gro
Copy link
Member

T-Gro commented Sep 3, 2025

/run ilverify

Copy link
Contributor

github-actions bot commented Sep 3, 2025

🔧 CLI Command Report

  • Command: /run ilverify
  • Outcome: success

✅ Patch applied:
- Files changed: 4
- Lines changed: 52

@auduchinok
Copy link
Member Author

This has been ready since last Tuesday. I'd like to continue to work on it in subsequent PRs, but this is getting stale.

@edgarfgp
Copy link
Contributor

edgarfgp commented Sep 9, 2025

This has been ready since last Tuesday. I'd like to continue to work on it in subsequent PRs, but this is getting stale.

@auduchinok if its only to update the ilverify. Happy to send a PR to your fork. If so please fix the conflicts then I will try and run the ilverify on my machine and see if that helps

auduchinok and others added 4 commits September 9, 2025 18:02
# Conflicts:
#	tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.SurfaceArea.netstandard20.release.bsl
@auduchinok
Copy link
Member Author

@T-Gro Is there anything I could do to help in getting it reviewed/merged?

@edgarfgp
Copy link
Contributor

Ping @vzarytovskii in case we can merge this.

Copy link
Member

@vzarytovskii vzarytovskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally fine with it, apart from the memory footprint question.

@github-project-automation github-project-automation bot moved this from New to In Progress in F# Compiler and Tooling Sep 12, 2025
@auduchinok
Copy link
Member Author

Ping.

@T-Gro T-Gro merged commit 4ded394 into dotnet:main Sep 16, 2025
38 checks passed
@auduchinok auduchinok deleted the fcs-getCapturedType branch September 16, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants