* fixes #7167
* spec: distinct types can be ordinal types
* bootstrapping issue
This commit is contained in:
Andreas Rumpf 2019-05-22 11:50:05 +02:00 • committed by GitHub
commit 1e97b420bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 4 deletions

View file

@ -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'