-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Default member implementation changed to member during formatting #742
Comments
Did a little investigation. If Fantomas doesn't get origin source code on formatting (which is usual on building sources from pure AST), it doesn't get Trivia from it and can't find what particular word ( fantomas/src/Fantomas/CodePrinter.fs Lines 719 to 729 in 49073f2
Emitting This change breaks 10 tests with interface being implemented, but everything compiles well: type IFoo =
abstract foo: int
let foo =
{ new IFoo with
override __.foo = 1 } |
It'd be really great to preserve the keyword in AST somehow. |
@auduchinok currently Fantomas preserves the keyword in Problem arise when you are trying to create sources from pure AST which lacks info about what keyword has been used. The only sign that this member is abstract dispatch slot is Emitting |
fixed in #743 |
Fantomas: 3.3.0
FSharp.Compiler.Service: 34.1.0
OS: macOS Catalina 10.15.3
Description
Roundtrip parsing and formatting abstract class code gives code which doesn't compile.
Default member implementation of abstract property is being ignored and changed to usual member which causes compile error in FSC
Repro
Expected
formatted
should containdefault
methodfoo
Actual
formatted
doesn't have default implementation offoo
and code doesn't compileThe text was updated successfully, but these errors were encountered: