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

generate tyFromExpr for typeof static param with generic base type #24745

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Mar 2, 2025

fixes #24743, refs #24718

We cannot do this in general for any expression with generic type because the typeof logic is called for things like type Foo in:

type Foo[T] = object

proc init(_: type Foo) = discard

We also cannot use containsUnresolvedType to work around this specific case because the base type of static[auto] is not unresolved, it is a typeclass that isn't lifted to a parameter. The behavior of generating tyFromExpr is also consistent with pre-2.0, so we do this in this special case of static.

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.

Regression from Nim 2.0/2.2 to devel with type K[w: static[auto]] = typeof(w)
1 participant