syntax - Can this be interpreted as an invocation expression in C#? -


according c# grammar, 1 can write

(a)(b) 

which can interpreted either invocation expression or type cast. can please provide valid c# example interprets case invocation expression?

this grammar rule i'm referring to:

invocation-expression:     primary-expression   (   argument-list?   ) 

and primariy-expression can parenthesised expression.

like this?

((action<string>)console.writeline)("test"); 

or this, expression:

((func<int>)console.read)() 

edit: doubt there way primary-expression simple identifier, gets parsed cast (even (writeline)()), it's not big deal, can remove parentheses.


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -