You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following example, y is treated as an export, even though it's a local variable like b.
importcore.stdc.stdio : printf;
voidmain() { printf("result is %d\n", foo(10)); }
alias foo = fooMaker!((int x) {
int y = x +1;
return y;
});
intfooMaker(alias cb)(int a) {
int b = a +1;
returncb(b);
}
If I run dub run dscanner -- --ctags a.d, I get:
!_TAG_FILE_FORMAT 2
!_TAG_FILE_SORTED 1
!_TAG_FILE_AUTHOR Brian Schott
!_TAG_PROGRAM_URL https://github.com/dlang-community/D-Scanner/
foo a.d 5;" a line:5
main a.d 3;" f line:3 signature:()
y a.d 6;" v line:6
Thankfully the workaround is simple: Use a named function:
alias foo = fooMaker!fooInner;
private intfooInner(int x) {
int y = x +1;
return y;
}
The text was updated successfully, but these errors were encountered:
In the following example,
y
is treated as an export, even though it's a local variable likeb
.If I run
dub run dscanner -- --ctags a.d
, I get:Thankfully the workaround is simple: Use a named function:
The text was updated successfully, but these errors were encountered: