Skip to content

Conversation

@demotomohiro
Copy link
Contributor

No description provided.

@demotomohiro
Copy link
Contributor Author

demotomohiro commented Dec 12, 2025

Current code generates compile error from following code:

proc map[T](op: proc (): T) =
  discard op()

proc f(): string = "foo"
map(f)
mytests/testgene.nim(5, 4) template/generic instantiation of `map` from here
mytests/testgene.nim(1, 12) Error: invalid type: 'T' in this context: 'proc (op: proc (): T{.closure.})' for proc

Edit: Fixed the bug and it compiles without error.

@demotomohiro demotomohiro marked this pull request as draft December 12, 2025 12:34
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.

1 participant