qore icon indicating copy to clipboard operation
qore copied to clipboard

variant resolution can return abstract variants in complex class hierarchies with multiple inheritance

Open davidnich opened this issue 6 years ago • 1 comments

ex:

unhandled QORE System exception thrown in TID 79 at 2018-10-28 09:56:22.860347 Sun +01:00 (CET) in AbstractQorusService::getOption() (LocalQorusService.qc:636-638, user code)
ABSTRACT-VARIANT-ERROR: cannot call abstract variant AbstractQorusService::getOption(string field) directly
call stack:
  6: AbstractQorusService::getOption() (LocalQorusService.qc:636-638, user code)
  5: LocalQorusService::logIntern() (LocalQorusService.qc:267, user code)
  4: LocalQorusService::log() (Service.qc:38, user code)
  3: Service::log() (LocalQorusService.qc:88, user code)
  2: LocalQorusService::destructor() (AbstractQorusCoreService.qc:794, user code)
  1: AbstractQorusCoreService::delIntern() (AbstractQorusCoreService.qc:828, user code)

debug output:

8.857785: TID 79: QoreFunction::runtimeFindExactVariant() this: 0x7ff7b62e4280 AbstractQorusService::getOption() returning 0x7ff7b62e4100 getOption(string field) flags: 2 num_args: 218759888 abstract: 1

davidnich avatar Oct 28 '18 08:10 davidnich

this is still happening:

2019.06.18 16:21:32.483563 T23: System exception: LocalQorusService.qc:146 (Qore): RUNTIME-OVERLOAD-ERROR: no variant matching 'AbstractQorusService::getStartReasonText() can be found; no variants were accessible in this execution context
  *** RETHROW at ServiceManager.qc:1971 (Qore)
  Service::setupImpl() called at AbstractQorusCoreService.qc:754 (Qore user code)
  AbstractQorusCoreService::setup() called at ServiceManager.qc:1889 (Qore user code)
  ServiceManager::loadInternal() called at ServiceManager.qc:2020 (Qore user code)
  ServiceManager::loadService() called at qorus-common-server-api.ql:69 (Qore user code)
  ServiceGate::memberGate() called at qorus-shared-system.ql:310 (Qore user code)
  SystemServiceHelper::methodGate() called at QorusRestApiHandler.qc:8635 (Qore user code)
  JobRestClass::staticGetJob() called at QorusRestApiHandlerV2.qc:698 (Qore user code)
  JobRestClassV2::staticGetJob() called at QorusRestApiHandlerV3.qc:5141 (Qore user code)
  JobRestClassV3::subClassImpl() called at /usr/share/qore-modules/0.9.3/RestHandler.qm:691 (Qore user code)
  AbstractRestClass::subClass() called at /usr/share/qore-modules/0.9.3/RestHandler.qm:728 (Qore user code)
  AbstractRestClass::handleRequest() called at /usr/share/qore-modules/0.9.3/RestHandler.qm:743 (Qore user code)
  AbstractRestClass::handleRequest() called at /usr/share/qore-modules/0.9.3/RestHandler.qm:1298 (Qore user code)
  RestHandler::handleRequest() called at QorusRestApiHandler.qc:15834 (Qore user code)
  WebAppHandler::handleRequest() called at /usr/share/qore-modules/0.9.3/HttpServer.qm:1647 (Qore user code)
  HttpServer::handleRequest() called at /usr/share/qore-modules/0.9.3/HttpServer.qm:2363 (Qore user code)
  HttpListener::connectionThread() called at /usr/share/qore-modules/0.9.3/HttpServer.qm:2170 (Qore user code)
  HttpListener::<anonymous closure>() called at <builtin>:-1 (Qore user code)

The most derived class implements an abstract method inherited from the first class through inheritance of the second class; this should not be legal.

davidnich avatar Jun 18 '19 14:06 davidnich