See https://forum.dlang.org/thread/[email protected]
test case
---
void main()
{
struct A;
struct B;
alias V = void;
alias I = int;
V test0(@A I) {}
V test1(@A @(B) I) {}
V test2(@A @B I) {}
}
---
Comment #1 by b2.temp — 2020-04-28T10:02:03Z
Better TC:
---
void main()
{
struct A;
struct B { struct CD;}
alias V = void;
alias I = int;
V test0(@A I) {}
V test1(@A @(B) I) {}
V test2(@(B.CD) @B I) {}
V test3(@A I, @B @A I) {}
V test3(@A I, @(B.CD) @A I) {}
}
---
Comment #2 by b2.temp — 2020-04-28T10:23:04Z
forgott to rename last test func
---
void main()
{
struct A;
struct B { struct CD;}
alias V = void;
alias I = int;
V test0(@A I) {}
V test1(@A @(B) I) {}
V test2(@(B.CD) @B I) {}
V test3(@A I, @B @A I) {}
V test4(@A I, @(B.CD) @A I) {}
}
---
Comment #3 by b2.temp — 2020-04-28T10:34:52Z
Created attachment 1780
patch for the bug
Comment #4 by dlang-bot — 2020-05-01T03:57:15Z
@benjones updated dlang/dmd pull request #11086 "fix issue 20780 PR for the patch written by Basile-Z" fixing this issue:
- fix issue 20780 PR for the patch written by Basile-Z
https://github.com/dlang/dmd/pull/11086
Comment #5 by b2.temp — 2020-05-01T12:17:43Z
@benjones, thanks for taking the time to handle the PR. Since I cannot register on GH anymore here's a small review.
1. Check the formating of the case statement. The oginal patch was formatted correctly apparently (https://issues.dlang.org/attachment.cgi?id=1780&action=diff VS https://github.com/dlang/dmd/pull/11086/files#diff-cd066d37445cac534313c0137c2d4bbeR7274)
2. in order not to loose the authorship info, that are available with the patch, you must use:
$ git checkout -b issue-20780
$ git am 0001-fix-issue-20780-Function-parameter-UDA-not-accepted-.patch
instead of:
$ git checkout -b issue-20780
$ git apply 0001-fix-issue-20780-Function-parameter-UDA-not-accepted-.patch
Comment #6 by ben.james.jones — 2020-05-01T15:49:54Z
I didn't actually use the patch file before... Should be fixed now, can you double check?
Comment #7 by b2.temp — 2020-05-01T17:36:27Z
Yes thanks LGTM.
Git is very complete. It makes the difference between the author and the commiter, maybe other stuff too. If after a while it appears that the fix is not good people could blame me in person now ;)
Comment #8 by dlang-bot — 2020-05-03T19:34:36Z
dlang/dmd pull request #11086 "Fix issue 20780: Function parameter UDA not accepted in nested function declarations" was merged into master:
- c43171a7674459626e92e2c503d2c89a4491c24f by Basile Burg:
fix issue 20780 - Function parameter UDA not accepted in nested function declarations
https://github.com/dlang/dmd/pull/11086