-
Notifications
You must be signed in to change notification settings - Fork 791
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
Compile error: "primDestForallTy: not a forall type" #6528
Comments
I looked at this yesterday and it's easy to reproduce. Unfortunately it
does not show line numbers. It also does not reproduce in the IDE. Only if
you run a build. I tried to make the repro smaller but failed.
Joakim Sjøhaug <[email protected]> schrieb am Sa., 13. Apr. 2019,
23:57:
… On *dotnet build* or *dotnet run yarn-watch* compiler fails with an
internal error.
Repro steps
1.
Clone my repository from here
<https://github.com/JoakimSjo/fable-react-nobinaApp>
2.
Run *dotnet build* or *dotnet run yarn-watch* inside "src" folder.
Expected behavior
Compilation succede.
Actual behavior
Compilation fails with following error:
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 24.31 ms for /Users/joakimsjohaug/Projects/fsharp/nobina/app/src/app.fsproj.
Restore completed in 48.86 ms for /Users/joakimsjohaug/Projects/fsharp/nobina/app/src/app.fsproj.
error FS0192 : internal error : primDestForallTy: not a forall type [/Users/joakimsjohaug/Projects/fsharp/nobina/app/src/app.fsproj]
Build FAILED.
error FS0192 : internal error : primDestForallTy: not a forall type [/Users/joakimsjohaug/Projects/fsharp/nobina/app/src/app.fsproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:04.90
Related information
- Operating system: macOS 10.14.4
- Branch: master
- .NET: 2.2.103
- Editing Tools: Visual Studio Code
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6528>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AADgNPUvWj54a1V-__GcoTFavgQdEew7ks5vglK9gaJpZM4cuStP>
.
|
I can look at this one. |
@joakimsjo Do you still see this one? The repro has some older dependencies and it could be that a fix is in place, but not present in the current project. |
I just came across this issue and have no idea where to go from here :/ using latest net5 sdk and it seems like another FSharp.Core version resolution issue. |
Could you make a minimal repro? And try changing referenced FSharp.Core to see if that makes a difference? Also Just anything to reduce the matrix of possibilities and causes |
Also, it may be possible to propagate a range parameter down to |
I've only ever seen this manifest in fable projects (via bug reports) and so there is likely some subtle issue in the interplay of FSharp.Core there |
We have the same issue in our project and we found out following:
TLDR: Changing reference to Fable.Core 3.1.6 solved our problem 😅 I hope this information can help finding the issue. |
I followed the trail and made a smallest repro I could come up with. In the App.fs if you comment out Program.withDebugger compilation works and with this line it does not. module App
open Elmish
open Elmish.React
#if DEBUG
open Elmish.Debug
#endif
Program.mkProgram Index.init Index.update Index.view
|> Program.withReactSynchronous "elmish-app"
// #if DEBUG
// |> Program.withDebugger
// #endif
|> Program.run also with Fable.Core 3.1.6 compilation works and with 3.2.0 it does not. <?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Index.fs" />
<Compile Include="App.fs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Fable.Core" Version="3.1.6" />
<PackageReference Include="Fable.Elmish" Version="3.1.0" />
<PackageReference Include="Fable.Elmish.Debugger" Version="3.2.0" />
<PackageReference Include="Fable.Elmish.React" Version="3.0.1" />
<PackageReference Include="Fable.React" Version="7.2.0" />
</ItemGroup>
</Project> So, I guess it has to be something with Fable.Core 3.2.0 and implementation of Program.withDebugger in Fable.Elmish.Debugger. |
I tried following: |
Similar to @ThisFunctionalTom's repro, it's not only Fable.Elmish.Debugger that triggers this. It also triggers with Fable.Core + Feliz, but only in combination of newer versions of both. You can downgrade one or the other, either a) Fable.Core to 3.1.6, or b) Feliz to 0.5.0, and the error goes away even if you leave the other one at the newer version. Repro project here, you can
Things that do not affect the error:
|
One quirk I noticed, just a shot in the dark, is that Fable.Core depends on FSharp.Core 4.7.0 and Feliz depends on FSharp.Core 4.7.2. Fable.Core should really update to 4.7.2 at least. |
Thing is I pushed 3 Fable.Core releases recently:
So 3.2.1 already referenced 4.7.2 but it was causing problems too. Users say the problem appears with all Fable.Core 3.2.x versions. I myself haven't seen this error on macOS :/ |
I can reproduce the error on both Windows and macOS, using Fable.Core 3.2.x. In my case Removing Fable.Elmish.Debugger doesn't fix the issue so as suggested above I think it's caused by more packages. I'm using FSharp.Core 5.0.0 |
Had the same problem, pinning versions solved it. |
This combo worked for me:
<TargetFramework>netstandard2.1</TargetFramework> |
Yeah, 3.1.6 will work with any framework. In my tests 3.2 failed always. I'm leaving it pinned. |
With just
I get a different build error (see thoth-org/Thoth.Json#45):
The following combination worked:
|
Minimal repo: module App
let view () =
Fable.Helpers.ReactNative.view [] |
Ok, spent a large portion of time looking at this. The issue is a bit complex, but it relates to an API change in Fable.Core's // Fable.Core 3.1.6
let createObj (fields: #seq<string*obj>): obj = jsNative Today, it's this: // Fable.Core 3.2.0 >
let createObj (fields: seq<string*obj>): obj = jsNative The difference is that the former has a type argument due to the use of Then, as an example, in the Feliz library's // Feliz 0.6.0
type Html = ...
static member inline div (value: string) = Interop.reactElement "div" (createObj [ "children" ==> [| value |] ]) With Feliz 0.6.0 and Fable.Core 3.2.0, this simple example fails compilation: open Feliz
let view () =
Html.div "test" What I think is happening: If the Feliz library is compiled using Fable.Core 3.1.6, then using that Feliz library with a version of Fable.Core's library with the That isn't precisely the problem, but more or less it is - the nuance is in the generic first-class values with The easiest solution to this would be to re-compile the Feliz library (or other libraries) with the new version of Fable.Core. I don't know if it's the right solution to fix this issue in the compiler - though I think we should provide a much better error message indicating that it isn't compatible. |
Thanks a lot for this @TIHan. I'm an idiot, I did go through the changes from Fable.Core 3.1.6 to 3.2 looking for something out of place, but missed that one. Would it work if I push a new version of Fable.Core going back to the |
Thanks for the investigation and update @TIHan and @alfonsogarciacaro. The newest Fable.Core 3.2.3 with this update now compiles correctly for me, tested with both Feliz and Fable.Elmish.Debugger. |
Works! |
Works! Had the same issue! |
1 similar comment
Works! Had the same issue! |
Closing out this old issue |
On dotnet build or dotnet run yarn-watch compiler fails with an internal error.
Repro steps
Clone my repository from here
Run dotnet build or dotnet run yarn-watch inside "src" folder.
Expected behavior
Compilation succede.
Actual behavior
Compilation fails with following error:
Related information
The text was updated successfully, but these errors were encountered: