Skip to content

corrected static and non-static accessors - #149

Closed
Vulcano771 wants to merge 1 commit into
SkriptLang:2.xfrom
Vulcano771:2.x
Closed

corrected static and non-static accessors#149
Vulcano771 wants to merge 1 commit into
SkriptLang:2.xfrom
Vulcano771:2.x

Conversation

@Vulcano771

@Vulcano771 Vulcano771 commented Aug 31, 2025

Copy link
Copy Markdown
Contributor

This PR fixes ExprJavaCall.java's getters for methods.

If you for example have this code:

public class Test {

	private final boolean isActive;

	public Test() {
		isActive = true;
	}

	public boolean isActive() {
		return isActive;
	}

	public static boolean isActive(Test instance) {
		return instance.isActive();
	}

}

As Java compiles isActive() down to isActive(Test this) it falseley takes the instance method isActive instead of the correct method isActive(...).

Here's a small test:

on load:
	set {_s} to Test.isActive(new Test())

	set {_b} to new Test()

	broadcast "-> %{_s}%"
	broadcast "-> %{_b}.isActive()%"

@Vulcano771

Copy link
Copy Markdown
Contributor Author

Would be nice if someone could look over it
If you have better ideas how to fix this feel free to contribute

@sovdeeth sovdeeth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine to me

@Vulcano771

Copy link
Copy Markdown
Contributor Author

Okay, what now?

@sovdeeth

sovdeeth commented Sep 3, 2025

Copy link
Copy Markdown
Member

Wait for another review or when we want to do a release

@Vulcano771 Vulcano771 closed this by deleting the head repository Nov 13, 2025
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.

2 participants