Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion compiler/sigmatch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ proc matchGenericParam(m: var TCandidate, formal: PType, n: PNode) =
arg = newTypeS(tyStatic, m.c, son = evaluated.typ)
arg.n = evaluated
elif formalBase.kind == tyTypeDesc:
if arg.kind != tyTypeDesc:
if arg.kind != tyTypeDesc and
n.kind == nkSym and n.sym.kind == skType:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A type could also be seq[int]; types are more complex than "it's a symbol"...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would not these types (seq[int] be passed as typedesc, I didn't find the cases that are not passed as typedesc if not values

# make sure we have a type here
arg = makeTypeDesc(m.c, arg)
else:
arg = arg.skipTypes({tyTypeDesc})
Expand Down
6 changes: 6 additions & 0 deletions tests/errmsgs/t25262.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
discard """
errormsg: '''type mismatch: got <>'''
"""

proc v[T: typedesc]() = discard
v[0]()