-
Notifications
You must be signed in to change notification settings - Fork 429
Closed
Description
Describe the bug
The generated validateIntegrity method can contain a final data = instance.toColumns(true);
statement that defines an unused local variable.
This can be reproduced by having a table that contains only columns with a type converter.
For example:
enum Fruit {
apple,
pear,
}
class Foo extends Table {
Column<String> get fruit => textEnum<Fruit>()
.withDefault(const Variable('apple'))();
} @override
VerificationContext validateIntegrity(Insertable<FooData> instance,
{bool isInserting = false}) {
final context = VerificationContext();
final data = instance.toColumns(true); // The value of the local variable 'data' isn't used
context.handle(_fruitMeta, const VerificationResult.success());
return context;
}We don't necessarily need to avoid generating code like this. Adding the lint rule to ignore_for_file should fix this issue.
Metadata
Metadata
Assignees
Labels
No labels