Compile error: DualpaneMode not exhaustively matched #895

Closed
opened 2024-06-16 22:41:30 +00:00 by gmacon · 1 comment

I'm trying to package cwtch for NixOS, and I'm seeing this compilation error:

[        ] [+6771 ms] lib/settings.dart:314:13: Error: The type 'DualpaneMode' is not exhaustively matched by the switch cases since it doesn't match 'DualpaneMode.CopyPortrait'.
[        ] [        ]  - 'DualpaneMode' is from 'package:cwtch/settings.dart' ('lib/settings.dart').
[        ] [        ] Try adding a default case or cases that match 'DualpaneMode.CopyPortrait'.
[        ] [        ]     switch (m) {
[        ] [        ]             ^

Looking at the code, I think this is a "real" error (i.e. there really is a DualpaneMode.CopyPortrait variant and it really isn't handled), but I'm suspicious because I would have expected y'all to see this error, too. Based on the Git history, it looks like this code hasn't changed in years.

You can look at my derivations on GitHub.

Complete build log

I'm building v1.14.7 with Dart 3.3.4 and Flutter 3.13.8.

I'm trying to package cwtch for NixOS, and I'm seeing this compilation error: ``` [ ] [+6771 ms] lib/settings.dart:314:13: Error: The type 'DualpaneMode' is not exhaustively matched by the switch cases since it doesn't match 'DualpaneMode.CopyPortrait'. [ ] [ ] - 'DualpaneMode' is from 'package:cwtch/settings.dart' ('lib/settings.dart'). [ ] [ ] Try adding a default case or cases that match 'DualpaneMode.CopyPortrait'. [ ] [ ] switch (m) { [ ] [ ] ^ ``` Looking at the code, I think this is a "real" error (i.e. there really is a DualpaneMode.CopyPortrait variant and it really isn't handled), but I'm suspicious because I would have expected y'all to see this error, too. Based on the Git history, it looks like this code hasn't changed in years. You can look at my derivations [on GitHub](https://github.com/NixOS/nixpkgs/compare/release-24.05...gmacon:nixpkgs:cwtch). [Complete build log](https://paste.rs/VSLiQ) I'm building v1.14.7 with Dart 3.3.4 and Flutter 3.13.8.
sarah added the
bug
label 2024-06-17 21:22:23 +00:00
Owner

Ok, looked into this. This is actually an error (though that actual branch is unreachable). The error shows up for me as an optional lint, and not a compile-stopping issue.

I have two theories on why that may be:

  1. The nix build has warnings-as-errors enabled for flutter builds
  2. A Flutter version thing? We've been targeting 3.19 for a while, and 3.22 on dev (but I don't think that is it)

Either way, I'll update the code for 1.15 to fix this check.

Thanks for your packaging work!

Ok, looked into this. This is actually an error (though that actual branch is unreachable). The error shows up for me as an optional lint, and not a compile-stopping issue. I have two theories on why that may be: 1. The nix build has warnings-as-errors enabled for flutter builds 2. A Flutter version thing? We've been targeting 3.19 for a while, and 3.22 on dev (but I don't think that is it) Either way, I'll update the code for 1.15 to fix this check. Thanks for your packaging work!
sarah referenced this issue from a commit 2024-06-20 17:23:55 +00:00
sarah closed this issue 2024-06-24 16:15:27 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cwtch.im/cwtch-ui#895
No description provided.