Skip to content

fixes #13736; Compiler crash with auto return type and recursion - #26054

Open
ringabout wants to merge 2 commits into
develfrom
pr_extend_enum
Open

fixes #13736; Compiler crash with auto return type and recursion#26054
ringabout wants to merge 2 commits into
develfrom
pr_extend_enum

Conversation

@ringabout

Copy link
Copy Markdown
Member

fixes #13736

Comment thread compiler/semcall.nim Outdated

if finalCallee == c.p.owner and finalCallee.typ.returnType != nil and
finalCallee.typ.returnType.kind == tyAnything:
localError(c.config, info, "cannot infer type of recursive call")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

there's no fundamental reason the example should fail, ie it could take the type from the non-recursive branch

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah we have the commonType mechanism to sort out these things.

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.

Compiler crash with auto return type and recursion

3 participants