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

new-style concept fails to match #24451

Closed
Graveflo opened this issue Nov 18, 2024 · 0 comments
Closed

new-style concept fails to match #24451

Graveflo opened this issue Nov 18, 2024 · 0 comments

Comments

@Graveflo
Copy link
Contributor

Description

type
  A = object
    x: int
  B*[T] = object
    b: T
  AConcept* = concept
    proc implementation(s: var Self, p1: B[int])

proc implementation*(r: var A, p1: B[int])=
  discard

proc accept*(r: var AConcept)=
  discard

var a = A()
a.accept()

changing the typedef section to this and it will work:

type
  A = object
    x: int
  AConcept* = concept
    proc implementation(s: var Self, p1: B[int])
  B*[T] = object
    b: T

Nim Version

Nim Compiler Version 2.2.1 [Linux: amd64]
Compiled at 2024-11-15
Copyright (c) 2006-2024 by Andreas Rumpf

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

Current Output

Error: type mismatch
Expression: accept(a)
  [1] a: A

Expected one of (first mismatch at [position]):
[1] proc accept(r: var AConcept)

Expected Output

No response

Known Workarounds

No response

Additional Information

I had something similar happen with imports too. That scenario had the concept matching encounter tyGenericBody but I'm not sure if this is the same

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