We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Version Used: Latest
Steps to Reproduce: Define the Globals type as such:
public interface IGlobals { bool Foo(); } public interface IGlobals2 : IGlobals { bool Bar(); }
Now create the script with IGlobals2 as the injected global object type:
CSharpScript.Create<int>("Foo();", globalsType: typeof(IGlobals2),...);
Expected Behavior: script should compile and work.
Actual Behavior: error CS0120: An object reference is required for the non-static field, method, or property 'IGlobals.Foo'
However, if instead we use class inheritence, it will work:
public class Globals { public void Foo() { } } public class Globals2 : public Globals { public void Bar() { } } CSharpScript.Create<int>("Foo();", globalsType: typeof(Globals2),...);
The text was updated successfully, but these errors were encountered:
@jinujoseph is this confirmed a bug or an expected behavior?
Sorry, something went wrong.
Fixes scripting globals not looking at base interfaces correctly.
9f09707
Fixes dotnet#30947
Successfully merging a pull request may close this issue.
Version Used:
Latest
Steps to Reproduce:
Define the Globals type as such:
Now create the script with IGlobals2 as the injected global object type:
Expected Behavior:
script should compile and work.
Actual Behavior:
error CS0120: An object reference is required for the non-static field, method, or property 'IGlobals.Foo'
However, if instead we use class inheritence, it will work:
The text was updated successfully, but these errors were encountered: