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 FSHARP: This runtime coercion or type test from type 'a to string #13

Open
nojaf opened this Issue Nov 14, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@nojaf
Copy link

nojaf commented Nov 14, 2018

I'm getting some problems when compiling with Fable2.

I try

module FableProject.Tests

open Fable.Import.Jest
open Matchers
open FableProject.Library

test "Basic sum test" <| fun () ->
    sum 7 4 == 11

And I get

C:/temp/fable-template/Content/.fable/Fable.Import.Jest.1.9.0/Matchers.fs(75,69): (75,107) error FSHARP: This runtime coercion or type test from type
    'a
 to
    string
involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed.
C:/temp/fable-template/Content/.fable/Fable.Import.Jest.1.9.0/Matchers.fs(75,132): (75,170) error FSHARP: This runtime coercion or type test from type
    'a
 to
    string
involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed.
C:/temp/fable-template/Content/.fable/Fable.Import.Jest.1.9.0/Matchers.fs(76,70): (76,108) error FSHARP: This runtime coercion or type test from type
    'a
 to
    string
involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed.
C:/temp/fable-template/Content/.fable/Fable.Import.Jest.1.9.0/Matchers.fs(76,128): (76,166) error FSHARP: This runtime coercion or type test from type
    'a
 to
    string
involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed.
C:/temp/fable-template/Content/.fable/Fable.Import.Jest.1.9.0/Matchers.fs(87,2): (87,42) error FSHARP: This runtime coercion or type test from type
    'a
 to
    unit
involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed.
C:/temp/fable-template/Content/.fable/Fable.Import.Jest.1.9.0/Matchers.fs(90,2): (90,41) error FSHARP: This runtime coercion or type test from type
    'a
 to
    unit
involves an indeterminate type based on information prior to this program point. Runtime type tests are not allowed on some types. Further type annotations are needed.
fable: Compilation failed at 13:43:25 (11.890 s)
error Command failed with exit code 1.

Not entirely sure what is going wrong here, I hope it is related to Fable two. Maybe the bindings should be revisited.

Problem seems to be related to :?> string.
See R75
Error doesn't occur when sprintf is changed to:

| true -> createObj ["message" ==> (sprintf "Expected %A not to equal %A" (this?utils?printExpected(x)) (this?utils?printReceived(y))); "pass" ==> true]

Same with :?> unit on R90
Is resolved by

let toEqualNone (x):unit =
  expect.Invoke(x)?toEqualNone() |> ignore
@xdaDaveShaw

This comment has been minimized.

Copy link

xdaDaveShaw commented Nov 29, 2018

This has causing my CI process to fail since I left the dotnet-fable tool and went back to NPM - before it errored, but carried on. But now my Fake script sees it as an error and fails.

Thanks @nojaf for a working version of the Matchers.fs.
I've hacked it into my build pipeline for now. Overriding the version in the nuget cache before calling fable-splitter.

You can see my changes here:
xdaDaveShaw/XmasList@34f5a07

@nojaf

This comment has been minimized.

Copy link

nojaf commented Nov 29, 2018

Hi @xdaDaveShaw , I just downloaded my fixes from github via paket. See paket.dependencies.

Maybe that can work for you too.

@xdaDaveShaw

This comment has been minimized.

Copy link

xdaDaveShaw commented Nov 29, 2018

I was trying to think how to do that, but wasn't sure how hard / easy it would be to remove the package and use the Files. Wasn't as bad as I feared.

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