HaxeFoundation / HaxeFoundation/format

Unmatched null pattern

Open
#13 0 comments 0 reactions 1 assignee Claimed by @ncannasse View on GitHub
Dominant language
Haxe
Stars
139
Forks
65
PR merge metrics
No merged PRs in 30d

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` 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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.