Page 1 of 1

Named attribute parameters

PostPosted: January 7th, 2016, 10:40 pm
by weirdan
C# allows to pass named parameters to attributes, like this:
Code: Select all
[TestCase(1,2, Result=3)]

Does Phalanger allow it? In my testing it was either complaining about non-constant expression or failed to parse at '=' token.

Re: Named attribute parameters

PostPosted: January 8th, 2016, 5:39 pm
by Jakub Misek
It does, there is also a special syntax for named parameters (due to conflict with PHP syntax)
Code: Select all
$Result=>3

Re: Named attribute parameters

PostPosted: January 8th, 2016, 9:13 pm
by weirdan
Ah, with '=>' it parses ok. This doesn't help much though, as TestCaseAttribute does not compile for some other reason: https://github.com/DEVSENSE/Phalanger/issues/62

Re: Named attribute parameters

PostPosted: February 17th, 2016, 2:50 am
by diddledan
I've replied to your issue on GitHub but I think I'm wrong in my possible workaround. :-(