-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Heaps regression w/dev #9911
Comments
I had this locally as well when I was trying heaps with latest haxe, and I didn't understand this. Surely the expected type is an enum abstract type there. Maybe it gets lost somehow because |
This happens because the setter for function set_mode(m) { smode = cast m; return m; } https://github.com/HeapsIO/heaps/blob/06a72533183691e8857e52abde97e6c29229afab/h3d/shader/pbr/Slides.hx#L69-L69 |
Reduced: enum abstract Enm(String) {
var Full;
} Main.hx class Main {
static var x(never,set):Enm;
static function set_x(v) return v;
static function main() {
x = Full;
}
} |
Bisected to 72e61e0 |
Based on @Simn's comment in that commit I don't think we can fix this as it would toggle another issue. |
Should we not infer the setter argument to be of the type of the variable it binds ? |
I struggle to find a solution for this. |
Actually even hacking type-hints of setters in AST is not reliable because of overloading. |
Alex's example compiles on latest development, and nobody here mentioned how this was failing in the first place... I'll assume that this is not something urgent to look into. |
This reminds me of a change that was added to add some type inference to getters/setters, which I had to update because it was not checking if it was linked to an actual property. So uh maybe this issue was actually addressed but not closed? |
Ah yeah, it was probably #10569. |
Not sure since then but there is a regression with latest dev wrt heaps:
https://travis-ci.org/github/HeapsIO/heaps/jobs/736018107
The text was updated successfully, but these errors were encountered: