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

[Concepts] Recursive concepts cause a compiler segfault when testing with is #17630

Open
konsumlamm opened this issue Apr 3, 2021 · 0 comments
Labels

Comments

@konsumlamm
Copy link
Contributor

Example

type
  A = concept
    proc test(x: Self, y: A)

proc test(x: int, y: int) = discard

discard (int is A)

Current Output

The compiler crashes.

SIGSEGV: Illegal storage access. (Attempt to read from nil?)

Expected Output

An error message or successful compilation.

Possible Solution

  • Disallow referring to the concept being defined inside its definition.

Additional Information

$ nim -v
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2021-04-02
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: 9abd383
active boot switches: -d:release

@Araq Araq added the Concepts label Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants