Unmatched null pattern

Open
#13 0 comments 0 reactions 1 assignee View on GitHub

@ncannasse is already working on this.

Since Apr 23, 2014.

Assessment

This issue has not been assessed yet.

Description

https://github.com/HaxeFoundation/format/blob/master/format/swf/Writer.hx#L547

bits.writeBit(switch(data.fill) {
    case LS2FColor(_):  false;
    case LS2FStyle(_):  true;
});

https://github.com/HaxeFoundation/format/blob/master/format/swf/Writer.hx#L570

switch(data.fill) {
    case LS2FColor(color):  writeRGBA(color);
    case LS2FStyle(style):  writeFillStyle(ver, style);
}

The error is correct because LS2Data defines fill to be Null<LS2Fill> and Haxe now considers explicit null types for exhaustiveness.

The question is what should semantically happen if the field actually is null. Or should the fill field not be nullable after all?

Dominant language
Haxe
Stars
141
Forks
65
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HaxeFoundation/format

All issues in HaxeFoundation/format

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.