isar / isar/hive

Parent class private fields are not generated

Open
#1,012 0 comments 0 reactions 0 assignees View on GitHub
problem
Dominant language
Dart
Stars
4.4k
Forks
449
PR merge metrics
No merged PRs in 30d

Description

**Code sample**
```dart
class Animal {
@HiveField(0)
int _info;

Animal(this._info);
}

@HiveType(typeId: 0)
class Cat extends Animal {
@HiveField(1)
String name;

Cat(super._info, {required this.name});

Cat.create(this.name) : super(0);
}
```
This generates an error when generating the type adapter: _1 positional argument(s) expected, but 0 found_.

In the generated adapter:
```dart
return Cat(
name: fields[1] as String,
);
```

**Version**
- Platform: iOS, Android, Mac, Windows, Linux, Web
- Flutter version: 3.0.3
- Hive version: 2.2.1

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.