Skip to content

Conversation

@TIMONz1535
Copy link

@TIMONz1535 TIMONz1535 commented Apr 19, 2024

I have no idea what I'm doing, I have paws, but I fixed it.

  • Enable allowDuplicates for namespace symbols, so you can declare multiple namespaces with the same name. No more "redefinition" error.
  • Reuse the NamespaceBinder of the first namespace with the current name, so you can share methods between all scopes.
  • When lookup namespace container use the Last one, because it has all members. So don't report "ambiguous" error in that case.
  • Don't extrapolate function lookup to the upper scope for a qualified name, like invoke Shading::Decals::foo but get Shading::foo. Actually we need to check members in the container only, not in the whole binder tree.
  • Lots of tests for the namespace behavior. Correlates with the latest DXC release.

Known issues:
I didn't touch anything with struct, enum scopes. Probably it has similar issues.
Don't use nested namespaces with the same name, like namespace Shading { namespace Shading {} } it doesn't work properly.

example

namespace Shading { void foo(int x) {} }
namespace Shading { void foo() {} }
namespace Culling { namespace Decals { void foo(int x) {} } }
namespace Culling { namespace Decals { void foo() {} } }

… scopes. Do not lookup upper scope for qualified name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant