mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 06:18:51 +00:00
fixes #25009 Introduced by #24176, when matching a set type to another, if the given set is a constructor and the element types match worse than a generic match (which includes the case with no match), the match is always set to a convertible match, without checking that it is at least a convertible match. This is fixed by checking this.
17 lines
207 B
Nim
17 lines
207 B
Nim
# issue #25009
|
|
|
|
type EnumOne {.pure.} = enum
|
|
aaa
|
|
bbb
|
|
|
|
type EnumTwo {.pure.} = enum
|
|
ccc
|
|
ddd
|
|
eee
|
|
|
|
proc doStuff(e: set[EnumOne]) =
|
|
echo e
|
|
|
|
doStuff({EnumTwo.ddd}) #[tt.Error
|
|
^ type mismatch]#
|