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

Initial support lambda node #173

Merged
merged 1 commit into from
May 16, 2024
Merged

Conversation

euglena1215
Copy link
Contributor

Prior to this change, typeprof would crash on encountering code like:

def x = -> { 1 }

This was because typeprof did not yet support lambda.
With this update, such lambda definitions are now recognized as def x: -> Proc.
While the ideal scenario would be to infer the lambda's type directly (e.g., ^() -> Integer as in RBS), this initial step addresses the crash issue and provides basic support.

Prior to this change, typeprof would crash on encountering code like:

```rb
def x = -> { 1 }
```

This was because typeprof did not yet support lambda.
With this update, such lambda definitions are now recognized as `def x: -> Proc`.
While the ideal scenario would be to infer the lambda's type directly (e.g., `^() -> Integer` as in RBS),
this initial step addresses the crash issue and provides basic support.
@mame mame merged commit 647dc5e into ruby:v2 May 16, 2024
6 checks passed
@mame
Copy link
Member

mame commented May 16, 2024

Awesome. I agree that it is reasonable as an initial step, thanks!

@euglena1215 euglena1215 deleted the initial-support-lambda branch May 16, 2024 23:57
@euglena1215
Copy link
Contributor Author

I was able to work on this because I had a GOOD FIRST ISSUE GUIDE. Thank you too!

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

Successfully merging this pull request may close these issues.

2 participants