Bug 12047 – Regression (2.065 git-head): UDAs are not checked
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-31T09:12:00Z
Last change time
2014-02-06T17:55:03Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2014-01-31T09:12:37Z
-----
@asdfasdf // no error??
void foo() { }
void main()
{
}
-----
This compiles without error.
Comment #1 by andrej.mitrovich — 2014-01-31T09:14:30Z
Ok this is even more serious than I thought:
-----
template portable(alias func)
{
pragma(msg, "We're here");
}
@portable!foo
void foo(...) { }
void main() { }
-----
2.064:
$ dmd test.d
> We're here
2.065 git-head:
$ dmd test.d
>
The template is not being instantiated.
Comment #3 by github-bugzilla — 2014-02-06T17:13:07Z
Commits pushed to master at https://github.com/D-Programming-Language/dmdhttps://github.com/D-Programming-Language/dmd/commit/c2b869fc5ea3984e3c92e0841f3db1c0af2a5c4c
fix Issue 12047 - UDAs are not checked
This is also a refactoring change for UDA semantic analysis.
1. Run UDAs in semantic2 phase.
Currently forward reference resolution mechanism is not perfect. UDAs often depends on other declarations in user code. Therefore analysing them in semantic1 phase would easily hit fwdref issues.
On the other hand, if UDAs are not checked for conditional compilation, essentially they have no effect for final execution code. So, I think moving their analysis timing from semantic1 to semantic2 is not a problem.
2. Each Dsymbols now have a pointer to the enclosing UserAttributeDeclaration.
We can use UserAttributeDeclaration::scope for forward reference resolution of UDAs. So we can elide Dsymbol::userAttributesScope.
https://github.com/D-Programming-Language/dmd/commit/f9e3f41f4744079f220e0d64d62bd5e25994ceb2
Merge pull request #3183 from 9rnsr/fix12047
[REG2.065a] Issue 12047 - UDAs are not checked