[dmd-internals] [D-Programming-Language/dmd] c2b869: fix Issue 12047 - UDAs are not checked

GitHub noreply at github.com
Thu Feb 6 17:13:01 PST 2014


  Branch: refs/heads/master
  Home:   https://github.com/D-Programming-Language/dmd
  Commit: c2b869fc5ea3984e3c92e0841f3db1c0af2a5c4c
      https://github.com/D-Programming-Language/dmd/commit/c2b869fc5ea3984e3c92e0841f3db1c0af2a5c4c
  Author: k-hara <k.hara.pg at gmail.com>
  Date:   2014-02-02 (Sun, 02 Feb 2014)

  Changed paths:
    M src/attrib.c
    M src/attrib.h
    M src/class.c
    M src/declaration.c
    M src/dsymbol.c
    M src/dsymbol.h
    M src/enum.c
    M src/expression.h
    M src/func.c
    M src/scope.c
    M src/scope.h
    M src/struct.c
    M src/traits.c
    A test/fail_compilation/fail12047.d

  Log Message:
  -----------
  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.


  Commit: f9e3f41f4744079f220e0d64d62bd5e25994ceb2
      https://github.com/D-Programming-Language/dmd/commit/f9e3f41f4744079f220e0d64d62bd5e25994ceb2
  Author: Walter Bright <walter at walterbright.com>
  Date:   2014-02-06 (Thu, 06 Feb 2014)

  Changed paths:
    M src/attrib.c
    M src/attrib.h
    M src/class.c
    M src/declaration.c
    M src/dsymbol.c
    M src/dsymbol.h
    M src/enum.c
    M src/expression.h
    M src/func.c
    M src/scope.c
    M src/scope.h
    M src/struct.c
    M src/traits.c
    A test/fail_compilation/fail12047.d

  Log Message:
  -----------
  Merge pull request #3183 from 9rnsr/fix12047

[REG2.065a] Issue 12047 - UDAs are not checked


Compare: https://github.com/D-Programming-Language/dmd/compare/cbc100abebbc...f9e3f41f4744


More information about the dmd-internals mailing list