Fix references to members of results of static methods (#4327)

This commit is contained in:
Ryszard Rozak 2023-06-30 13:23:34 +02:00 committed by GitHub
parent 242f661644
commit 24a9f7c650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View File

@ -3049,7 +3049,8 @@ private:
}
UASSERT_OBJ(cpackagerefp->classOrPackagep(), m_ds.m_dotp->lhsp(), "Bad package link");
nodep->classOrPackagep(cpackagerefp->classOrPackagep());
m_ds.m_dotPos = DP_SCOPE;
// Class/package :: HERE function() . method_called_on_function_return_value()
m_ds.m_dotPos = DP_MEMBER;
m_ds.m_dotp = nullptr;
} else if (m_ds.m_dotp && m_ds.m_dotPos == DP_FINAL) {
nodep->dotted(m_ds.m_dotText); // Maybe ""

View File

@ -42,6 +42,18 @@ class Getter1;
endfunction
endclass
class uvm_root;
int x;
static uvm_root m_inst;
static function uvm_root get_inst();
if (m_inst == null) m_inst = new;
return m_inst;
endfunction
function int get_7();
return 7;
endfunction
endclass
module t (/*AUTOARG*/
);
@ -68,6 +80,11 @@ module t (/*AUTOARG*/
if (getter1.get_1 != 1) $stop;
uvm_root::get_inst().x = 6;
if (uvm_root::get_inst().x != 6) $stop;
if (uvm_root::get_inst().get_7() != 7) $stop;
$write("*-* All Finished *-*\n");
$finish;
end