Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3842 #3843

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Fable.Cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

* [All] Fixed Fable compiler hanging on some errors (#3842) (by @ncave)
* [JS/TS] Fixed DateTime.MinValue, DateTime.MaxValue (#3836) (by @ncave)

## 4.19.0 - 2024-06-10
Expand Down
2 changes: 1 addition & 1 deletion src/Fable.Cli/Entry.fs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ type Runner =

let startCompilation () =
State.Create(cliArgs, ?watchDelay = watchDelay, useMSBuildForCracking = useMSBuildForCracking)
|> startCompilation
|> startCompilationAsync
|> Async.RunSynchronously

return!
Expand Down
2 changes: 1 addition & 1 deletion src/Fable.Cli/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ let private compilationCycle (state: State) (changes: ISet<string>) =

type FileWatcherMsg = | Changes of timeStamp: DateTime * changes: ISet<string>

let startCompilation state =
let startCompilationAsync state =
async {
try
let state =
Expand Down
7 changes: 6 additions & 1 deletion src/Fable.Transforms/State.fs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ type ImplFile =

// add all entities to the entity cache
let entities = Dictionary()
let declarations = file.Declarations

let declarations =
try
file.Declarations // this may throw
with _ex ->
[]

FSharp2Fable.Compiler.getRootFSharpEntities declarations |> loop entities

Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/Compiler/Util/Compiler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module Compiler =

let result =
state
|> startCompilation
|> startCompilationAsync
|> Async.RunSynchronously

match result with
Expand Down
Loading