Skip to content

Commit b5c7af1

Browse files
authored
Work around SDK issue in v3.0-dev (#1262)
See dart-lang/sdk#50756
1 parent c6836ae commit b5c7af1

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

checked_yaml/lib/checked_yaml.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ class ParsedYamlException implements Exception {
120120
final Object? innerError;
121121

122122
ParsedYamlException(
123-
this.message,
124-
YamlNode yamlNode, {
123+
String message,
124+
YamlNode this.yamlNode, {
125125
this.innerError,
126126
}) :
127-
// ignore: prefer_initializing_formals
128-
yamlNode = yamlNode;
127+
// TODO(kevmoo) remove when dart-lang/sdk#50756 is fixed!
128+
message = message.replaceAll(" of ' in type cast'", ' in type cast');
129129

130130
factory ParsedYamlException.fromYamlException(YamlException exception) =>
131131
_WrappedYamlException(exception);

json_serializable/lib/builder.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ Builder jsonSerializable(BuilderOptions options) {
3939
lines.add(e.innerError.toString());
4040
}
4141

42-
throw StateError(lines.join('\n'));
42+
throw StateError(
43+
lines
44+
.join('\n')
45+
// TODO(kevmoo) remove when dart-lang/sdk#50756 is fixed!
46+
.replaceAll(" of ' in type cast'", ' in type cast'),
47+
);
4348
}
4449
}

json_serializable/pubspec.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,7 @@ dev_dependencies:
3939
yaml: ^3.0.0
4040

4141
dependency_overrides:
42+
checked_yaml:
43+
path: ../checked_yaml
4244
json_annotation:
43-
path: ../json_annotation
45+
path: ../json_annotation

0 commit comments

Comments
 (0)