Skip to content

cstring == nil doesn't compile #546

Open
@demotomohiro

Description

mytests/testcstring.nim:

var c: cstring
discard c == nil
$ ./bin/nimony c mytests/testcstring.nim 
bin/nimsem  --isSystem m nifcache/sys9azlf.1.nif nifcache/sys9azlf.2.nif nifcache/sys9azlf.2.idx.nif
bin/nimsem  m nifcache/tes6cgtz1.1.nif nifcache/tes6cgtz1.2.nif nifcache/tes6cgtz1.2.idx.nif
Traceback (most recent call last)
src/nimony/nimsem.nim(120) nimsem
src/nimony/nimsem.nim(117) handleCmdLine
src/nimony/nimsem.nim(50) singleModule
src/nimony/sem.nim(5558) semcheck
src/nimony/sem.nim(749) semStmt
src/nimony/sem.nim(5270) semExpr
src/nimony/sem.nim(3493) semDiscard
src/nimony/sem.nim(5344) semExpr
src/nimony/sem.nim(1648) semCall
nim-2.3.1/lib/system/iterators_1.nim(1480) resolveOverloads
src/nimony/sembasics.nim(157) buildErr
mytests/testcstring.nim(2, 11) Error: Type mismatch at [position]
[1] expected: (u +64) but got: (cstring)
[1] expected: (i +16) but got: (cstring)
[1] expected: (i +64) but got: (cstring)
[1] (cstring) does not match constraint Enum.0.sys9azlf
[1] expected: (ref T.27.sys9azlf) but got: (cstring)
[1] expected: (ptr T.28.sys9azlf) but got: (cstring)
[1] expected: string.0.sys9azlf but got: (cstring)
[1] expected: (u +32) but got: (cstring)
[1] expected: (pointer) but got: (cstring)
[1] expected: (set T.26.sys9azlf) but got: (cstring)
[1] expected: string.0.sys9azlf but got: (cstring)
[1] expected: (bool) but got: (cstring)
[1] expected: (f +32) but got: (cstring)
[1] expected: (c +8) but got: (cstring)
[1] expected: (i +8) but got: (cstring)
[1] expected: (i +32) but got: (cstring)
[1] expected: (u +8) but got: (cstring)
[1] expected: (u +16) but got: (cstring)
[1] expected: (f +64) but got: (cstring)
Type mismatch at [position]
[1] expected: (u +64) but got: (cstring)
[1] expected: (i +16) but got: (cstring)
[1] expected: (i +64) but got: (cstring)
[1] (cstring) does not match constraint Enum.0.sys9azlf
[1] expected: (ref T.27.sys9azlf) but got: (cstring)
[1] expected: (ptr T.28.sys9azlf) but got: (cstring)
[1] expected: string.0.sys9azlf but got: (cstring)
[1] expected: (u +32) but got: (cstring)
[1] expected: (pointer) but got: (cstring)
[1] expected: (set T.26.sys9azlf) but got: (cstring)
[1] expected: string.0.sys9azlf but got: (cstring)
[1] expected: (bool) but got: (cstring)
[1] expected: (f +32) but got: (cstring)
[1] expected: (c +8) but got: (cstring)
[1] expected: (i +8) but got: (cstring)
[1] expected: (i +32) but got: (cstring)
[1] expected: (u +8) but got: (cstring)
[1] expected: (u +16) but got: (cstring)
[1] expected: (f +64) but got: (cstring)

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions