From 6ac9109c0ac80f836bfb6fbf2df662c0cb9c9fbf Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Fri, 21 Jun 2019 09:44:38 +0200 Subject: [PATCH] Fix dead code in generated update companions --- moor/example/example.g.dart | 4 ---- moor/test/data/tables/todos.g.dart | 5 ----- moor_generator/lib/src/writer/update_companion_writer.dart | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/moor/example/example.g.dart b/moor/example/example.g.dart index 9f4794e3..0a9deacf 100644 --- a/moor/example/example.g.dart +++ b/moor/example/example.g.dart @@ -87,7 +87,6 @@ class CategoriesCompanion implements UpdateCompanion { throw ArgumentError( 'Hit an invalid state while serializing data. Did you run the build step?'); } - ; } } @@ -277,7 +276,6 @@ class RecipesCompanion implements UpdateCompanion { throw ArgumentError( 'Hit an invalid state while serializing data. Did you run the build step?'); } - ; } } @@ -478,7 +476,6 @@ class IngredientsCompanion implements UpdateCompanion { throw ArgumentError( 'Hit an invalid state while serializing data. Did you run the build step?'); } - ; } } @@ -675,7 +672,6 @@ class IngredientInRecipesCompanion throw ArgumentError( 'Hit an invalid state while serializing data. Did you run the build step?'); } - ; } } diff --git a/moor/test/data/tables/todos.g.dart b/moor/test/data/tables/todos.g.dart index 2438bba5..3ae07ad8 100644 --- a/moor/test/data/tables/todos.g.dart +++ b/moor/test/data/tables/todos.g.dart @@ -146,7 +146,6 @@ class TodosTableCompanion implements UpdateCompanion { throw ArgumentError( 'Hit an invalid state while serializing data. Did you run the build step?'); } - ; } } @@ -352,7 +351,6 @@ class CategoriesCompanion implements UpdateCompanion { throw ArgumentError( 'Hit an invalid state while serializing data. Did you run the build step?'); } - ; } } @@ -567,7 +565,6 @@ class UsersCompanion implements UpdateCompanion { throw ArgumentError( 'Hit an invalid state while serializing data. Did you run the build step?'); } - ; } } @@ -767,7 +764,6 @@ class SharedTodosCompanion implements UpdateCompanion { throw ArgumentError( 'Hit an invalid state while serializing data. Did you run the build step?'); } - ; } } @@ -931,7 +927,6 @@ class TableWithoutPKCompanion implements UpdateCompanion { throw ArgumentError( 'Hit an invalid state while serializing data. Did you run the build step?'); } - ; } } diff --git a/moor_generator/lib/src/writer/update_companion_writer.dart b/moor_generator/lib/src/writer/update_companion_writer.dart index 3da313d1..234973cb 100644 --- a/moor_generator/lib/src/writer/update_companion_writer.dart +++ b/moor_generator/lib/src/writer/update_companion_writer.dart @@ -48,6 +48,6 @@ class UpdateCompanionWriter { ..write('default: throw ArgumentError(' "'Hit an invalid state while serializing data. Did you run the build " "step?');") - ..write('};}\n'); + ..write('}\n}\n'); } }