Skip to content

fix: type inference for lambdas and their parameters#1304

Merged
lars-reimann merged 3 commits intomainfrom
lambda-parameter-type-inference
Jan 4, 2025
Merged

fix: type inference for lambdas and their parameters#1304
lars-reimann merged 3 commits intomainfrom
lambda-parameter-type-inference

Conversation

@lars-reimann
Copy link
Member

@lars-reimann lars-reimann commented Jan 4, 2025

Summary of Changes

The following code led to a stack overflow when inferring the type of the call marked with the arrow:

pipeline p {
    g(() -> "1", (a) -> 2); // <-- here
}


@Pure
fun g<T>(
    q2: () -> b: T,
    q1: (a: T) -> (),
)

This PR fixes this.

@github-actions
Copy link

github-actions bot commented Jan 4, 2025

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ REPOSITORY git_diff yes no 0.13s
✅ TYPESCRIPT eslint 3 0 0 4.59s
✅ TYPESCRIPT prettier 3 0 0 1.1s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@codecov
Copy link

codecov bot commented Jan 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.72%. Comparing base (5a949c2) to head (e0b2f9f).
Report is 32 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1304      +/-   ##
==========================================
- Coverage   99.72%   99.72%   -0.01%     
==========================================
  Files         114      114              
  Lines       12811    12793      -18     
  Branches     4212     4203       -9     
==========================================
- Hits        12776    12758      -18     
  Misses         35       35              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lars-reimann lars-reimann merged commit a9e070f into main Jan 4, 2025
6 checks passed
@lars-reimann lars-reimann deleted the lambda-parameter-type-inference branch January 4, 2025 17:38
lars-reimann pushed a commit that referenced this pull request Jan 4, 2025
## [0.23.0](v0.22.0...v0.23.0) (2025-01-04)

### Features

* categorize API elements ([#1285](#1285)) ([3275900](3275900)), closes [#1243](#1243)
* optional error messages for constraints ([#1275](#1275)) ([fce761c](fce761c)), closes [#1082](#1082)
* prevent editing built-in stubs ([#1282](#1282)) ([d02c30a](d02c30a))
* show placeholders in outline ([#1286](#1286)) ([3880bfe](3880bfe))

### Bug Fixes

* subtype check for literal and union types ([#1288](#1288)) ([911881c](911881c))
* subtype check for literal and union types (part 2) ([#1289](#1289)) ([56284cf](56284cf))
* type inference for lambdas and their parameters ([#1304](#1304)) ([a9e070f](a9e070f))
@lars-reimann
Copy link
Member Author

🎉 This PR is included in version 0.23.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant