parent
30da566d9d
commit
cc08a9015e
3 changed files with 43 additions and 1 deletions
|
|
@ -27,6 +27,8 @@ false
|
|||
true
|
||||
-1
|
||||
Meow
|
||||
10 0.0
|
||||
1 2.0
|
||||
'''
|
||||
joinable: false
|
||||
"""
|
||||
|
|
@ -500,3 +502,26 @@ var r, b: Fp2[6, uint64]
|
|||
|
||||
prod(r, b)
|
||||
|
||||
|
||||
block: # bug #21263
|
||||
type
|
||||
DateDayFraction = concept # no T, an atom
|
||||
proc date(a: Self): int
|
||||
proc fraction(b: Self): float
|
||||
Date = distinct int
|
||||
DateDayFractionImpl = object
|
||||
date : int
|
||||
fraction : float
|
||||
|
||||
proc date(a: Date): int = a.int
|
||||
proc fraction(a:Date): float = 0.0
|
||||
|
||||
proc date(a: DateDayFractionImpl): int = a.date
|
||||
proc fraction(b: DateDayFractionImpl): float = b.fraction
|
||||
|
||||
|
||||
proc print(a: DateDayFraction) =
|
||||
echo a.date, " ", a.fraction
|
||||
|
||||
print(10.Date) # ok
|
||||
print(DateDayFractionImpl(date: 1, fraction: 2)) # error
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue