Open
Description
Defining a concept without any type that matches it, leads to errors when trying to use that concept.
Example
type
Comparable = concept
proc compare(a, b: Self): int # so that there are no conflicts with `cmp`
proc test[T: Comparable](x, y: T) =
echo compare(x, y)
Current Output
Error: undeclared identifier: 'compare'
Expected Output
No error.
Possible Solution
Make name resolution consider concept declarations (compare
in this case).
Additional Information
$ nim -v
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2021-03-18
Copyright (c) 2006-2021 by Andreas Rumpf
git hash: de5a8265384c2f23eca744b4fc9feda9721faefd
active boot switches: -d:release