Skip to content

[null safety] False positive when passing {a:Int} to {} #12454

@tobil4sk

Description

@tobil4sk
@:nullSafety
function main() {
  final other:{a:Int} = {a: 10};
  final data:{} = other; // ok
    
  final data:{} = {a: 10}; // Null safety: Cannot assign nullable value here.
}

With null safety disabled it unifies fine. Not a recent regression, the error goes back at least to 4.0.5.

https://try.haxe.org/#79528e3a

Metadata

Metadata

Assignees

No one assigned

    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