mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
Make typeRel behave to spec (#22261)
The goal of this PR is to make `typeRel` accurate to it's definition for generics: ``` # 3) When used with two type classes, it will check whether the types # matching the first type class (aOrig) are a strict subset of the types matching # the other (f). This allows us to compare the signatures of generic procs in # order to give preferrence to the most specific one: ``` I don't want this PR to break any code, and I want to preserve all of Nims current behaviors. I think that making this more accurate will help serve as ground work for the future. It may not be possible to not break anything but this is my attempt. So that it is understood, this code was part of another PR (#22143) but that problem statement only needed this change by extension. It's more organized to split two problems into two PRs and this issue, being non-breaking, should be a more immediate improvement. --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import std/[times, strformat]
|
||||
import std/assertions
|
||||
|
||||
doAssert fmt"{getTime()}" == $getTime()
|
||||
doAssert fmt"{now()}" == $now()
|
||||
let aTime = getTime()
|
||||
doAssert fmt"{aTime}" == $aTime
|
||||
let aNow = now()
|
||||
doAssert fmt"{aNow}" == $aNow
|
||||
|
||||
Reference in New Issue
Block a user