[WIP] Fix #308: Use delegates for lambdas#367
[WIP] Fix #308: Use delegates for lambdas#367alfonsogarciacaro wants to merge 2 commits intomasterfrom
Conversation
| let name = d.name.getText() | ||
| let asAlias() = | ||
| { | ||
| Comments = readCommentsAtLocation checker d.name |
There was a problem hiding this comment.
This doesn't seem to work, it doesn't get the comment in test/fragments/custom/delegate.d.ts. Any ideas?
There was a problem hiding this comment.
It does work in my local copy:
/// This does something
type Delegate1 =
delegate of arg1: float * ?optArg1: string * ?optArg2: string -> unitBut this uncovered an issue with testing: comments aren't checked to match in both files. Delegate1 in *.expected.fs doesn't contain the comment, while the generated *.fs file does. And yet the test passes.
(which makes sense for the header comment (// ts2fable 0.0.0), but not for xml comments)
When your using the web-app, check if your really using localhost:8080 and NOT https://fable.io/ts2fable/.
I'm definitely not writing this because that just happened to me....
There was a problem hiding this comment.
Ah, you're right thanks! Actually I was just looking at the tests and wondered why it wasn't failing without the comment 😅
Inspired by @Booksbaum great contributions, I gave it a go at fixing #308. However I realized this breaks fragments/react/f2.fs because delegates cannot be inherited, so maybe we cannot use delegates at the end :/