sugar syntaxic to access parent class member #14924
Labels
Issue-Enhancement
the issue is more of a feature request than a bug
Resolution-No Activity
Issue has had no activity for 6 months or more
WG-Language
parser, language semantics
Hi guys !!
In Inheritance, we deal with base classes and child classes. If we have to intermediately access baseclass members including variables and methods then we need to have some mechanism. This mechanism of accessing the base class members is provided in PS using a ugly syntax
output: hello
The above code shows how to access the member variables of the base class from the derived class when the member variables are declared with the same name both in the base as well as derived class. i use the standard syntax
_[Baseclass]::new().foo_
output: hello
i refer to the $foo variable of the base class using “
$base.foo
” while the derived class variable $foo is accessed wilth$this
qualifieroutput: 11
another example with different method signature
output: powershell
The text was updated successfully, but these errors were encountered: