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

Regression from 1.6 to 2.0 using static parameter in return type with function taking typeclass #23751

Closed
tersec opened this issue Jun 21, 2024 · 3 comments
Labels
Needs Backporting/Fixed in Devel The issues can be solved via backporting

Comments

@tersec
Copy link
Contributor

tersec commented Jun 21, 2024

Description

proc b(x: SomeUnsignedInt): int = 
proc t(w: static uint64): array[b(w), int] = discard

Builds in 1.6 and devel but not 2.0.

Nim Version

Builds:

Nim Compiler Version 1.6.21 [Linux: amd64]
Compiled at 2024-06-21
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 6789859503e900dda3059733c7b3391118c044d8
active boot switches: -d:release
Nim Compiler Version 1.6.21 [Linux: amd64]
Compiled at 2024-06-21
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 6789859503e900dda3059733c7b3391118c044d8
active boot switches: -d:release
user@epenomi:~$ nimdevel/bin/nim --version

Does not build:

Nim Compiler Version 2.0.6 [Linux: amd64]
Compiled at 2024-06-21
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: c00e8e71e0c8465b5a5257c76c674b803273b222
active boot switches: -d:release

Current Output

k.nim(2, 34) template/generic instantiation of `b` from here
k.nim(1, 8) Error: cannot instantiate: 'SomeUnsignedInt'

Expected Output

Builds

Possible Solution

Backport fix from devel to version-2-0

Additional Information

No response

@metagn
Copy link
Collaborator

metagn commented Jun 21, 2024

Should be same as #23730? So backport of #23731 to 2.0 should be enough

@metagn metagn added the Needs Backporting/Fixed in Devel The issues can be solved via backporting label Jun 21, 2024
@narimiran
Copy link
Member

So backport of #23731 to 2.0 should be enough

I'll do it tomorrow (together with some other commits that need to be backported too).

@narimiran
Copy link
Member

Backported now. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Backporting/Fixed in Devel The issues can be solved via backporting
Projects
None yet
Development

No branches or pull requests

3 participants