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

error FS0073: internal error: Undefined or unsolved type variable: ^_?82069 #331

Open
gusty opened this issue Jul 5, 2020 · 1 comment

Comments

@gusty
Copy link
Member

gusty commented Jul 5, 2020

This is a problem we find from time to time.

@NickDarvey just posted a small repro in our Slack (thanks Nick) so I'm creating this issue on his behalf and also to track it, since this issue has been already identified in the compiler and a fix exists.

#r @"c:\Users\gus\.nuget\packages\fsharpplus\1.1.1\lib\net45\FSharpPlus.dll"
open FSharpPlus
open FSharpPlus.Data

module Repro =
    type Customer = { Name : string }
    type Remote<'Value> = ResultT<Result<'Value, string> option>
    let appendCustomerResponse (existing : Customer NonEmptyList Remote) (next : Customer Remote) =
        lift2 NonEmptyList.cons next existing

This fails with the above error, which is clearly an FSharp Compiler error (that's normally the case when it's internal error).

It seems to me that @dsyme already solved that issue in the branch for RFC1043 but unfortunately doesn't seem to be happy to bring it to master as an independent fix, which to me clearly is as I've been experiencing it since ages.

Here's a link to the discussion, and his repsonse.

dotnet/fsharp#6805 (comment)

@dsyme I hope you reconsider it, I mean, if RFC1043 is gonna make it into F#5 I'm fine but I'm not sure that will be the case..

@gusty
Copy link
Member Author

gusty commented Jul 5, 2020

Here's a run of the repro, using the feature/ext branch of the compiler (no preview switch)

> #r @"c:\Users\gus\.nuget\packages\fsharpplus\1.1.1\lib\net45\FSharpPlus.dll" ;;

--> Referenced 'c:\Users\gmpl2\.nuget\packages\fsharpplus\1.1.1\lib\net45\FSharpPlus.dll' (file may be locked by F# Interactive process)

> #r @"c:\Repos\FSharpPlus\src\FSharpPlus\bin\Release\net45\FSharpPlus.dll"
-
- open FSharpPlus
- open FSharpPlus.Data
-
- module Repro =
-     type Customer = { Name : string }
-     type Remote<'Value> = ResultT<Result<'Value, string> option>
-     let appendCustomerResponse (existing : Customer NonEmptyList Remote) (next : Customer Remote) =
-         lift2 NonEmptyList.cons next existing
- ;;

--> Referenced 'c:\Users\gus\.nuget\packages\fsharpplus\1.1.1\lib\net45\FSharpPlus.dll' (file may be locked by F# Interactive process)

module Repro = begin
  type Customer =
    { Name: string }
  [<Struct>]
  type Remote<'Value> = FSharpPlus.Data.ResultT<Result<'Value,string> option>
  val appendCustomerResponse :
    existing:Remote<FSharpPlus.Data.NonEmptyList<Customer>> ->
      next:Remote<Customer> ->
        FSharpPlus.Data.ResultT<Result<FSharpPlus.Data.NonEmptyList<Customer>,
                                       string> option>
end

As you can see, it works as expected, without any issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant