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

Add decorator types to function type #11253

Merged
merged 3 commits into from
May 2, 2024
Merged

Add decorator types to function type #11253

merged 3 commits into from
May 2, 2024

Conversation

plredmond
Copy link
Contributor

@plredmond plredmond commented May 2, 2024

  • Add decorators: Vec<Type> to FunctionType struct
  • Thread decorators through two add_function definitions
  • Populate decorators at the callsite in infer_symbol_type
  • Small test

@plredmond plredmond requested a review from carljm May 2, 2024 23:08
Copy link
Contributor

github-actions bot commented May 2, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

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

Just make the expect -> ? change and then I think this is good to merge!

EDIT: also look into the pre-commit failure?

crates/red_knot/src/types.rs Show resolved Hide resolved
crates/red_knot/src/types/infer.rs Outdated Show resolved Hide resolved
crates/red_knot/src/types/infer.rs Outdated Show resolved Hide resolved
@carljm
Copy link
Contributor

carljm commented May 2, 2024

Should I add more cases to infer_expr_type which is currently a todo?

Not in this PR! We will want to flesh that out eventually, but it's separable from this PR.

@plredmond plredmond requested a review from carljm May 2, 2024 23:42
Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@plredmond plredmond marked this pull request as ready for review May 2, 2024 23:58
@plredmond plredmond merged commit b90a937 into main May 2, 2024
19 checks passed
@plredmond plredmond deleted the redknot-decorators branch May 2, 2024 23:58
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