-
-
Notifications
You must be signed in to change notification settings - Fork 662
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
Check The Robert Issue #9417
Comments
using Main.Ext;
abstract D(Dynamic) to Dynamic {}
class Ext {
public static function round(f:Float) {}
}
class Main {
static function main() {
var d:D = null;
d.round();
}
} |
(replacing |
That makes it a variant of #5924 and the question Kevin asked in the last comment there becomes relevant. Now I'm somewhat worried about breaking this (for |
This change forbid not only dynamic to anything, but other types of implicit casts one might consider non-dangerous. Examples (connected to #9652): using Lambda;
using Main.ParentTools;
abstract Foo<T>(T) from T to T {}
class Parent { public function new() {} }
class Child extends Parent {}
class ParentTools { public static function tool(that: Parent) {} }
class Main {
public static function main() {
var parentFoo: Foo<Parent> = new Parent();
parentFoo.tool();
var childFoo: Foo<Child> = new Child();
childFoo.tool(); // error
var arrayFoo: Foo<Array<Int>> = new Array<Int>();
arrayFoo.count(); // error
}
} So now Question: is this intended result of the change or just an unplanned consequence? |
@Simn ? |
So I don't forget: There's a potential problem with access on something that tries really hard to not look like
Dynamic
picking up non-Dynamic static extensions.The text was updated successfully, but these errors were encountered: