Skip to content

Commit

Permalink
Work around SDK issue in v3.0-dev (#1262)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo authored Dec 19, 2022
1 parent c6836ae commit b5c7af1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 4 additions & 4 deletions checked_yaml/lib/checked_yaml.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ class ParsedYamlException implements Exception {
final Object? innerError;

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

factory ParsedYamlException.fromYamlException(YamlException exception) =>
_WrappedYamlException(exception);
Expand Down
7 changes: 6 additions & 1 deletion json_serializable/lib/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ Builder jsonSerializable(BuilderOptions options) {
lines.add(e.innerError.toString());
}

throw StateError(lines.join('\n'));
throw StateError(
lines
.join('\n')
// TODO(kevmoo) remove when dart-lang/sdk#50756 is fixed!
.replaceAll(" of ' in type cast'", ' in type cast'),
);
}
}
4 changes: 3 additions & 1 deletion json_serializable/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ dev_dependencies:
yaml: ^3.0.0

dependency_overrides:
checked_yaml:
path: ../checked_yaml
json_annotation:
path: ../json_annotation
path: ../json_annotation

0 comments on commit b5c7af1

Please sign in to comment.