-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invoking generic procedure that uses varargs implicit conversion acts incorrectly #11154
Comments
Adding a call to |
At first sight I thought this would be the same thing as #11155, but it isn't. The Btw a non generic version of proc convert(arg: HSlice): string = discard
proc implicitConvert(args: varargs[string, convert]) = discard
# non generic version of ``test``
proc test*(arg: HSlice[int,int]) =
implicitConvert(arg) |
Any leads on how to address this? I seem to be suffering from the same or a similar issue. My error
proc selectOneToMany*[O: Model, T: Model](dbHandler; oneEntry: O): Option[seq[T]] =
var objs = @[
when T is Lobby: newLobby()
elif T is Player: newPlayer()
elif T is Game: newGame()
elif T is Participation: newParticipation()]
try:
dbHandler.dbConn.selectOneToMany[:O, T](oneEntry, objs)
except NotFoundError:
return none(seq[T])
result = some(objs) Edit: My work-aroundeither proc selectOneToManyShunt(dbHandler) =
## this proc is never used and exists solely to please the compiler
var arg = @[newPlayer()]
dbHandler.dbConn.selectOneToMany(newLobby(), arg) or right after imports export dbValue |
Invoking generic procedure that uses varargs implicit conversion breaks.
Example
a.nim
b.nim
Current Output
Expected Output
Should compile.
Additional Information
Adding explicit generic parameters to
HSlice
intest
proc makes program compile.The text was updated successfully, but these errors were encountered: