Skip to content

Commit

Permalink
Delete unreachable default clause.
Browse files Browse the repository at this point in the history
The Dart analyzer will soon be changed so that if the `default` clause
of a `switch` statement is determined to be unreachable by the
exhaustiveness checker, a new warning of type
`unreachable_switch_default` will be issued. This parallels the
behavior of the existing `unreachable_switch_case` warning, which is
issued whenever a `case` clause of a `switch` statement is determined
to be unreachable. For details see
dart-lang/sdk#54575.

This PR deletes an unreachable `default` clause from `dart-sass` now,
to avoid a spurious warning when the analyzer change lands.
  • Loading branch information
stereotype441 committed Aug 28, 2024
1 parent 9f82850 commit dd49a24
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/src/ast/sass/statement/stylesheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ final class Stylesheet extends ParentStatement<List<Statement>> {
return Stylesheet.parseScss(contents, url: url, logger: logger);
case Syntax.css:
return Stylesheet.parseCss(contents, url: url, logger: logger);
default:
throw ArgumentError("Unknown syntax $syntax.");
}
} on SassException catch (error, stackTrace) {
var url = error.span.sourceUrl;
Expand Down

0 comments on commit dd49a24

Please sign in to comment.