Skip to content

Commit

Permalink
Delete unreachable default clause. (#2323)
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 authored Aug 30, 2024
1 parent a7f623d commit 56a4237
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 56a4237

Please sign in to comment.