Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unmatched null pattern #13

Open
Simn opened this issue Apr 23, 2014 · 0 comments
Open

Unmatched null pattern #13

Simn opened this issue Apr 23, 2014 · 0 comments
Assignees

Comments

@Simn
Copy link
Member

Simn commented Apr 23, 2014

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants