-
Notifications
You must be signed in to change notification settings - Fork 72
[FEATURE] Support for get
and set
functions
#191
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
Open
KoloInDaCrib
wants to merge
1
commit into
larsiusprime:develop
Choose a base branch
from
KoloInDaCrib:getters-n-setters
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+129
−0
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4feee7d
to
00cf919
Compare
00cf919
to
28a6197
Compare
AbnormalPoof
suggested changes
Apr 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to review this but I don't think it's compiling properly...
ERROR /Volumes/THE HOLE/FNF STUFF/FNF Repos/Funkin-Base/.haxelib/polymod/git/polymod/hscript/_internal/PolymodInterpEx.hx:286: characters 29-37
286 | var v = fop(expr(e1),expr(e2));
| ^^^^^^^^
| Too many arguments
ERROR /Volumes/THE HOLE/FNF STUFF/FNF Repos/Funkin-Base/.haxelib/polymod/git/polymod/hscript/_internal/PolymodInterpEx.hx:302: characters 33-36
302 | return super.evalAssignOp(op, fop, e1, e2);
| ^^^
| (Dynamic -> Dynamic) -> Dynamic should be (Dynamic, Dynamic) -> Unknown<0>
| For function argument 'fop'
ERROR /Volumes/THE HOLE/FNF STUFF/FNF Repos/Funkin-Base/.haxelib/polymod/git/polymod/hscript/_internal/PolymodInterpEx.hx:274: characters 20-32
274 | override function evalAssignOp(op:String, fop:(Dynamic->Dynamic)->Dynamic, e1:Expr, e2:Expr)
| ^^^^^^^^^^^^
| Field evalAssignOp overrides parent class with different or incomplete type
-> /Volumes/THE HOLE/FNF STUFF/FNF Repos/Funkin-Base/.haxelib/hscript/git/hscript/Interp.hx:152: characters 11-23
152 | function evalAssignOp(op,fop,e1,e2) : Dynamic {
| ^^^^^^^^^^^^
| Base field is defined here
| error: (Dynamic -> Dynamic) -> Dynamic should be (Dynamic, Dynamic) -> Unknown<0>
| have: (..., (..., ...) -> ..., ..., ...) -> ...
| want: (..., ... -> ..., ..., ...) -> ...
28a6197
to
069b126
Compare
AbnormalPoof
approved these changes
Apr 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
holy shit peak PR:
var test(get, set):Bool;
var _test:Bool = false;
function get_test():Bool {
trace("TEST");
return _test;
}
function set_test(value) {
trace("TEST");
_test = value;
}
public function new()
{
trace(test);
test = true;
trace(test);
}
hscriptClass(assets/test.hxc):32: TEST
hscriptClass(assets/test.hxc):49: false
hscriptClass(assets/test.hxc):37: TEST
hscriptClass(assets/test.hxc):32: TEST
hscriptClass(assets/test.hxc):51: true
NotHyper-474
approved these changes
Apr 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes FunkinCrew/Funkin#3781
Doesn't have any other PR that has to be merged in order to work, hooray!!!
for getting the variable, the words supported are "get", "null" and everything else (i.e. "default")
for setting the variable, the words supported are "set", "never", "null" and everything else (i.e. "default")
also uhh haven't had the chance to test this that much so like if you want to uh test it yourself n stuff