Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for searching for alternate invocees for externs #129

Open
wants to merge 1 commit into
base: 1.0-dev
Choose a base branch
from

Conversation

bdunderscore
Copy link
Collaborator

For certain C# methods, Udon exposes the method via a different type than Roslyn considers it to be defined on. One example is
System.Type.Name, which is actually defined in System.Reflection.MemberInfo, but exposed via System.Type.Name.

This change allows U# to locate these alternate extern symbols and use them transparently. We move the logic for checking whether
symbols are exposed to udon down into BoundExternMethodInvocation, then teach this class to search declared interfaces and
superclasses of the invocation target (rather than the symbol's containing type) for defined externs.

Note that we assume that any exposed extern will match if we find it via a constructed symbol here.

For certain C# methods, Udon exposes the method via a different type than Roslyn considers it to be defined on. One example is
`System.Type.Name`, which is actually defined in `System.Reflection.MemberInfo`, but exposed via `System.Type.Name`.

This change allows U# to locate these alternate extern symbols and use them transparently. We move the logic for checking whether
symbols are exposed to udon down into BoundExternMethodInvocation, then teach this class to search declared interfaces and
superclasses of the _invocation_ target (rather than the symbol's containing type) for defined externs.

Note that we assume that any exposed extern will match if we find it via a constructed symbol here.
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