Hello,
I use some complex ref types as follows:
type
PTimeInfo = ref DateTime
TimeInfoEvent = ref object of PTimeInfo
channel : int
command : string
Then I use a variable of TimeInfoEvent in a function to initialize it:
proc initTimeInfoEvent(tie : TimeInfoEvent, ch : int = 0, cmd : string = "") =
var ti=now()
tie.channel = ch
tie.command = cmd
tie.second = ti.second
tie.hour = ti.hour
tie.minute = ti.minute
It compiles correctly using Nim 1.0.6, but it fails with Nim 1.4.0 (even using --useVersion:1.0 option):
Error: type mismatch: got <TimeInfoEvent, SecondRange>
but expected one of:
proc second=(dt: var DateTime; value: SecondRange)
first type mismatch at position: 1
required type for dt: var DateTime
but expression 'tie' is of type: TimeInfoEvent
How can I fix it?