Fix pre-existing HintCode.UNNECESSARY_TYPE_CHECK_TRUE
This prepares for landing https://dart-review.googlesource.com/c/sdk/+/190360 into the analyzer.
PiperOrigin-RevId: 394392683
diff --git a/lib/message_format.dart b/lib/message_format.dart
index 7b31ac9..60061e1 100644
--- a/lib/message_format.dart
+++ b/lib/message_format.dart
@@ -253,8 +253,6 @@
var patternValue = currentPattern._value;
var patternType = currentPattern._type;
- _checkAndThrow(patternType is _BlockType,
- 'The type should be a block type: $patternType');
switch (patternType) {
case _BlockType.string:
result.add(patternValue as String);
@@ -410,7 +408,6 @@
var pluralResult = Queue<String>();
_formatBlock(option!, namedParameters, ignorePound, pluralResult);
var plural = pluralResult.join('');
- _checkAndThrow(plural is String, 'Empty block in plural.');
if (ignorePound) {
result.add(plural);
} else {
@@ -562,8 +559,6 @@
if (_ElementType.string == thePart._type) {
block = _BlockTypeAndVal(_BlockType.string, thePart._value);
} else if (_ElementType.block == thePart._type) {
- _checkAndThrow(thePart._value is String,
- 'The value should be a string: ${thePart._value}');
var blockType = _parseBlockType(thePart._value);
switch (blockType) {
@@ -614,7 +609,6 @@
var pos = 0;
while (pos < parts.length) {
var thePart = parts.elementAt(pos);
- _checkAndThrow(thePart._value is String, 'Missing select key element.');
var key = thePart._value;
pos++;
@@ -664,7 +658,6 @@
var pos = 0;
while (pos < parts.length) {
var thePart = parts.elementAt(pos);
- _checkAndThrow(thePart._value is String, 'Missing plural key element.');
var key = thePart._value;
pos++;
@@ -722,7 +715,6 @@
var pos = 0;
while (pos < parts.length) {
var thePart = parts.elementAt(pos);
- _checkAndThrow(thePart._value is String, 'Missing ordinal key element.');
var key = thePart._value;
pos++;