Skip to content

Commit

Permalink
Replaced ?. operator with . operator
Browse files Browse the repository at this point in the history
Resolves error "The argument type 'HiveList<T>?' can't be assigned to the parameter type 'HiveList<T>'.

Closes issue isar#664.
  • Loading branch information
Milo Gilad committed Jul 15, 2021
1 parent 8873f75 commit fecc496
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hive_generator/lib/src/class_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class ClassBuilder extends Builder {
String _cast(DartType type, String variable) {
var suffix = _suffixFromType(type);
if (hiveListChecker.isAssignableFromType(type)) {
return '($variable as HiveList$suffix)?.castHiveList()';
return '($variable as HiveList$suffix).castHiveList()';
} else if (iterableChecker.isAssignableFromType(type) &&
!isUint8List(type)) {
return '($variable as List$suffix)${_castIterable(type)}';
Expand Down

0 comments on commit fecc496

Please sign in to comment.