-
-
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
multimethods: Error: internal error: cgmeth.genConv #3550
Comments
Following on this issue It seems to me that the following should to be the solution since their common ancestor doesn't have 'dummy_method'. But this doesn't work either! error: main_module.nim(18, 8) Error: method is not a base Is this another bug or something i missed? type
BaseEvent* = object of RootObj
data:pointer
Control* = object of RootObj
state: bool
Button* = object of Control
is_clicked : bool
Dialog* = object of Control
content: seq[RootObj]
method dummy_event*(self: Button, ev: BaseEvent) : bool {.base.} =
discard
method dummy_event*(self: Dialog, ev: BaseEvent) : bool {.base.} =
discard |
Whatever the compiler implements, it has to be consistent (right now it isn't) and in the spec. |
So, how this problem could be solved? Any workaround? |
type
ByteArray* = ref object of RootObj
OutputStream* = ref object of RootObj
method CopyTo*(ba, target: ByteArray): int = discard
method CopyTo*(ba: ByteArray, os: OutputStream): int = discard this is perhaps related with the above issue
ver 0.11.2: compile success if the |
the following code create a compiler error:
Error: internal error: cgmeth.genConv
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c
main_module.nim(21, 21) Error: internal error: cgmeth.genConv
Traceback (most recent call last)
nim.nim(107) nim
nim.nim(71) handleCmdLine
main.nim(251) mainCommand
main.nim(63) commandCompileToC
modules.nim(221) compileProject
modules.nim(169) compileModule
passes.nim(206) processModule
passes.nim(129) closePasses
cgen.nim(1310) myClose
cgmeth.nim(259) generateMethodDispatchers
cgmeth.nim(231) genDispatcher
cgmeth.nim(21) genConv
msgs.nim(991) internalError
msgs.nim(965) liMessage
msgs.nim(837) handleError
msgs.nim(821) quit
FAILURE
VERSION:
Nim Compiler Version 0.12.1 (2015-11-15) [Linux: amd64]
Copyright (c) 2006-2015 by Andreas Rumpf
git hash: 0f7fdd8
active boot switches: -d:release
the problem disappear if BaseEvent changed to 'int' or another basic type but warn that second 'dummy_event' should have 'base' pragma.
Also the compiler doesn't accept 'base' pragma on second method if both arguments are objects
The text was updated successfully, but these errors were encountered: