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

[WIP] Fix #308: Use delegates for lambdas #367

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alfonsogarciacaro
Copy link
Member

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 :/

@@ -610,6 +610,7 @@ let readAliasDeclaration (checker: TypeChecker) (d: TypeAliasDeclaration): FsTyp
let name = d.name.getText()
let asAlias() =
{
Comments = readCommentsAtLocation checker d.name
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to work, it doesn't get the comment in test/fragments/custom/delegate.d.ts. Any ideas?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does work in my local copy:

/// This does something
type Delegate1 =
    delegate of arg1: float * ?optArg1: string * ?optArg2: string -> unit

But 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....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right thanks! Actually I was just looking at the tests and wondered why it wasn't failing without the comment 😅

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

Successfully merging this pull request may close these issues.

2 participants