Skip to content

abstract casts and dynamic field access #3461

Closed
@nadako

Description

@nadako
abstract A(Dynamic) from Dynamic to Dynamic {}

class Main {
    static function main() {
        var a:A = {};
        a.test; // A has no field test
    }
}

Is this too crazy?

I got that while working on making node.js url externs. Its URL objects have this field:

@:optional var query:EitherType<String,Dynamic<String>>;

It contains either a string or a dynamic object parsed from that string, depending on the argument given to the parse function. I suppose it's designed to allow field access to it in pure-js.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions