Skip to content

Error on returning a large value type from a def#12801

Draft
straight-shoota wants to merge 1 commit intocrystal-lang:masterfrom
straight-shoota:feature/error-large-value-type
Draft

Error on returning a large value type from a def#12801
straight-shoota wants to merge 1 commit intocrystal-lang:masterfrom
straight-shoota:feature/error-large-value-type

Conversation

@straight-shoota
Copy link
Member

This patch adds compiler errors when passing large value types.

It's a work in progress, currently only implemented for method return types.

Resolves #4452

@asterite
Copy link
Member

How's the compiler performance with this?
Is this such a big issue to spend time on?

@straight-shoota
Copy link
Member Author

straight-shoota commented Nov 29, 2022

I have not done any performance testing. I'm not even sure this is the right place to do this. That's why I'm starting as a draft to maybe get some comments.

Is this such a big issue to spend time on?

I think it's a very bad user experience when your program takes forever to compile without any indication of what is wrong. We know the cause for that and we can detect it, so it would be great if the compiler could tell it.

@asterite
Copy link
Member

Such checks should be done in the "cleanup" phase (CleanupTransformer.) Doing that check every time a node gets a type is a bit overkill.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LLVM4 crash: Cannot select ... & other errors in codegen

2 participants