parent
2ab34b5eeb
commit
722ab9306a
|
|
@ -2765,11 +2765,15 @@ private:
|
|||
m_ds.m_dotSymp = foundp;
|
||||
ok = m_ds.m_dotPos == DP_SCOPE;
|
||||
} else if (const AstNodeFTask* const ftaskp = VN_CAST(foundp->nodep(), NodeFTask)) {
|
||||
if (!ftaskp->isFunction()) {
|
||||
|
||||
if (!ftaskp->isFunction() ||
|
||||
ftaskp->classMethod() ) {
|
||||
ok = m_ds.m_dotPos == DP_NONE;
|
||||
if (ok) {
|
||||
// The condition is true for tasks, properties and void functions.
|
||||
// The condition is true for tasks,
|
||||
// properties and void functions.
|
||||
// In these cases, the parentheses may be skipped.
|
||||
// Also SV class methods can be called without parens
|
||||
AstFuncRef* const funcRefp
|
||||
= new AstFuncRef{nodep->fileline(), nodep->name(), nullptr};
|
||||
nodep->replaceWith(funcRefp);
|
||||
|
|
|
|||
|
|
@ -135,6 +135,9 @@ private:
|
|||
// VISITs
|
||||
void visit(AstNodeFTask* nodep) override {
|
||||
if (!nodep->user1SetOnce()) { // Process only once.
|
||||
// Mark class methods
|
||||
if (VN_IS(m_modp, Class)) nodep->classMethod(true);
|
||||
|
||||
V3Config::applyFTask(m_modp, nodep);
|
||||
cleanFileline(nodep);
|
||||
VL_RESTORER(m_ftaskp);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ endclass : Cls
|
|||
|
||||
module t (/*AUTOARG*/);
|
||||
initial begin
|
||||
int tmp_i;
|
||||
Cls c;
|
||||
if (c != null) $stop;
|
||||
c = new;
|
||||
|
|
@ -24,7 +25,9 @@ module t (/*AUTOARG*/);
|
|||
if (c.get_methoda() != 20) $stop;
|
||||
c.setv_methoda(30);
|
||||
if (c.get_methoda() != 30) $stop;
|
||||
if (c.get_methoda != 30) $stop;
|
||||
c.setv_methoda(300);
|
||||
tmp_i = c.get_methoda;
|
||||
if (tmp_i != 300) $stop;
|
||||
$write("*-* All Finished *-*\n");
|
||||
$finish;
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue