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

converter + concept causes compiler to quit without error #6249

Closed
GULPF opened this Issue Aug 16, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@GULPF
Copy link
Member

GULPF commented Aug 16, 2017

With this code, the compiler exits after printing file.nim(1, 2) Hint: 'x' is declared but not used [XDeclaredButNotUsed], without outputting anything (no nimcache, not binary, no errors).

type
    Obj1[T] = object
        v: T

    Obj2 = ref object

    PrintAble = concept x
        $x is string

converter toObj1[T](t: T): Obj1[T] =
    return Obj1[T](v: t)

proc `$`[T](nt: Obj1[T]): string =
    when T is PrintAble: discard
    else: discard

echo Obj2()

@Araq Araq added this to the v1 milestone Jun 8, 2018

@Araq

This comment has been minimized.

Copy link
Member

Araq commented Oct 2, 2018

This now compiles and works.

@Araq Araq closed this in 400a7ff Oct 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment