Skip to content

Type check scripts against the SDK reference assemblies - #333

Merged
nojaf merged 1 commit into
ionide:mainfrom
nojaf:fix-type-check-scripts
Sep 12, 2026
Merged

nojaf merged 1 commit into
ionide:mainfrom
nojaf:fix-type-check-scripts

Conversation

@nojaf

@nojaf nojaf commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

GetProjectOptionsFromScript defaults to assumeDotNetFramework = true, so a .fsx passed with --script was resolved against the .NET Framework reference assemblies. FSharp.Core then failed to load and everything coming from it (printfn, string, int, ...) was undefined. Those constructs end up as error recovery nodes in the typed tree, which analyzers cannot match on, so a --script run silently reported nothing for most of the script.

Also warn when a project or script does not type check, so a run that can only cover part of the code no longer looks clean.

Fixes #332

GetProjectOptionsFromScript defaults to assumeDotNetFramework = true, so a
.fsx passed with --script was resolved against the .NET Framework reference
assemblies. FSharp.Core then failed to load and everything coming from it
(printfn, string, int, ...) was undefined. Those constructs end up as error
recovery nodes in the typed tree, which analyzers cannot match on, so a
--script run silently reported nothing for most of the script.

Also warn when a project or script does not type check, so a run that can
only cover part of the code no longer looks clean.

Fixes ionide#332
@nojaf
nojaf merged commit 5fee3d7 into ionide:main Sep 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typed tree for a .fsx omits bare top-level expressions

1 participant