Skip to content

Maybe not a bug. Safety: Cannot cast nullable value to not nullable type with Std.instance #17

@restorer

Description

@restorer
class SomeClass {
    public function new() {}
}

class MaybeBug12 {
    public function bug() : Void {
        var a = new SomeClass();

        // Safety: Cannot cast nullable value to not nullable type.
        // Probably this is not a bug in Safety, and this issue related to Std.instance() signature
        var b : Null<SomeClass> = Std.instance(a, SomeClass);
    }
}

See https://github.com/restorer/haxe-safety-bugs/blob/master/safetybugs/Main.hx#L163 for working example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions