* fixes #7167 * spec: distinct types can be ordinal types * bootstrapping issue
This commit is contained in:
parent
57bc8d73b4
commit
1e97b420bb
4 changed files with 23 additions and 4 deletions
|
|
@ -2,6 +2,10 @@ discard """
|
|||
output: '''
|
||||
tdistinct
|
||||
25
|
||||
false
|
||||
false
|
||||
false
|
||||
false
|
||||
'''
|
||||
"""
|
||||
|
||||
|
|
@ -83,3 +87,14 @@ type
|
|||
const d: DistTup = DistTup((
|
||||
foo:"FOO", bar:"BAR"
|
||||
))
|
||||
|
||||
|
||||
# bug #7167
|
||||
|
||||
type Id = distinct range[0..3]
|
||||
|
||||
proc `<=`(a, b: Id): bool {.borrow.}
|
||||
|
||||
var xs: array[Id, bool]
|
||||
|
||||
for x in xs: echo x # type mismatch: got (T) but expected 'bool'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue