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
dynamic cast operator !! lack of warnings during build! #1895
Comments
LOL, I expected even no warning, then I read the linked documentation. |
I should have marked this feature as experimental ;) It seems the F# compiler introduced some extra bindings to fix dotnet/fsharp#6487 so Fable wasn't reading the AST properly. It will be fixed in the next Fable release 👍 |
@alfonsogarciacaro thank you for the quick answer! |
type IMyInterface =
abstract foo: string with get, set
abstract bar: float with get, set
abstract baz: int option with get, set
type INoWarning =
inherit IMyInterface
abstract more : string with get, set
// Warning, "more" is missing
let p: INoWarning = !!{| foo = 5; bar = 4. |}
// Warning, foo is the wrong type
let r: INoWarning = !!{| more= ""; foo = 5; bar = 4. |}
// Ok, all is fine!
let q: INoWarning = !!{| more= ""; foo = "5"; bar = 4. |}
@alfonsogarciacaro I think I found an unexpected behavior with the code above! The compiler only shows the first expected warning but not the second! Let me know if I should open another issue :D |
Yeah, I think we're not supporting interface inheritance in this feature yet. Ok, let's open again this issue and I'll have a look. Hopefully it's not too difficult to fix :) |
Description
Following the docs here: https://fable.io/docs/communicate/js-from-fable.html#Plain-Old-JavaScript-Objects .
I was expecting the code below to raise warnings when building it!
Repro code
Expected and actual results
Expected a warning, got nothing.
Related information
$ npm show fable-compiler version
2.3.23
Win 10 enterprise Insiders
The text was updated successfully, but these errors were encountered: