Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9164

Re: doubts in narrow casting

$
0
0

Hi,

*call method o_super->m4.  "throws syntax error.


but when i change this to m4 in brackets:

call method o_super->('m4'). "works fine WHY!!!!!! (atleast no syntax error)


but the prog dumps.

Basically what is the diff between two above statements.

 

What you have written by adding brackets is a dynamic method call. Syntax checker is is no run-time environment and the correctness of dynamic method call will not be evaluated until run-time... That's why syntax error goes away, and run-time error comes. And, obviously, nothing in the call is working "fine".

 

cheers

Jānis


Viewing all articles
Browse latest Browse all 9164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>