From 20c6d83ae951e8877034404b71a0d1dc2e861d4e Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Mon, 23 Nov 2020 22:03:59 +0000 Subject: [PATCH] Support calls to inherited methods without "this." prefix (GitHub issue #388). (cherry picked from commit 55e06db6932960407dea0493cf91fcc2580a9290) --- elaborate.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/elaborate.cc b/elaborate.cc index ae3345cde..5d92ec153 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -3536,8 +3536,10 @@ NetProc* PCallTask::elaborate_usr(Design*des, NetScope*scope) const // For SystemVerilog this may be a few other things. if (gn_system_verilog()) { NetProc *tmp; - // This could be a method attached to a signal? - tmp = elaborate_method_(des, scope); + // This could be a method attached to a signal + // or defined in this object? + bool try_implicit_this = scope->get_class_scope() && path_.size() == 1; + tmp = elaborate_method_(des, scope, try_implicit_this); if (tmp) return tmp; // Or it could be a function call ignoring the return? tmp = elaborate_function_(des, scope);