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

Can't use typed macro pragma on procedure taking generic type as parameter #19358

Open
Menduist opened this issue Jan 10, 2022 · 0 comments
Open

Comments

@Menduist
Copy link
Contributor

Menduist commented Jan 10, 2022

Example

type Gen[T] = ref object
    field: T
    
macro noop*(prc: typed) = prc

proc gen[T](g: T): T {.noop.} = g

proc genObj[T](g: Gen[T]): T {.noop.} = g.field

Current Output

/tmp/test.nim(8, 22) Error: cannot instantiate Gen [type declared in /tmp/test.nim(1, 6)]
got: <T>
but expected: <T>

gen works, but not genObj

$ nim -v
Nim Compiler Version 1.7.1 [Linux: amd64]
Compiled at 2022-01-10
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: b098546da051ed026e85a9f398e74c396c79a8ad

Probably related to nim-lang/RFCs#44

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

No branches or pull requests

1 participant