Named attribute parameters

Discussion about the open-source Phalanger [?] project.

Named attribute parameters

Postby weirdan » January 7th, 2016, 10:40 pm

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.
weirdan
 
Posts: 17
Joined: June 4th, 2013, 1:11 am

Re: Named attribute parameters

Postby Jakub Misek » January 8th, 2016, 5:39 pm

It does, there is also a special syntax for named parameters (due to conflict with PHP syntax)
Code: Select all
$Result=>3
Jakub Misek │ DEVSENSE s.r.o. │ Email: jakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2056
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Named attribute parameters

Postby weirdan » January 8th, 2016, 9:13 pm

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
weirdan
 
Posts: 17
Joined: June 4th, 2013, 1:11 am

Re: Named attribute parameters

Postby diddledan » February 17th, 2016, 2:50 am

I've replied to your issue on GitHub but I think I'm wrong in my possible workaround. :-(
User avatar
diddledan
 
Posts: 14
Joined: March 19th, 2015, 2:59 pm
Location: Hampshire, UK


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 2 guests

cron

User Control Panel

Login

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 62 on January 7th, 2012, 10:54 pm

Users browsing this forum: No registered users and 2 guests
Phalanger