Skip to content

Conversation

@alexfikl
Copy link
Contributor

@alexfikl alexfikl commented Jan 8, 2025

Added some more typing to cgen during the break that caused some errors in loopy. This preemptively fixes them :D

Comment on lines +842 to 846
assert isinstance(function_decl, FunctionDeclarationWrapper)
if not isinstance(function_body, Block):
function_body = Block([function_body])

fbody = FunctionBody(function_decl, function_body)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This if could be in cgen, but the current docs say that FunctionBody takes a block:
https://github.com/inducer/cgen/blob/738bdb6ea330de63dc1e476025b8ca693b535443/cgen/__init__.py#L992-L1006


if tv.initializer is not None:
decl = Initializer(decl, generate_array_literal(
init_decl = Initializer(decl, generate_array_literal(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is necessary because Initializer takes a Declarator, not a Generable (like the forced annotation above).

@inducer inducer merged commit 82634b7 into inducer:main Jan 8, 2025
18 checks passed
@inducer
Copy link
Owner

inducer commented Jan 8, 2025

LGTM, thx!

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