Open dickermoshe opened 5 months ago
@schultek Seems like a simple check here should suffice: https://github.com/schultek/dart_mappable/blob/4777e79cdc99e15730d18990e1d774edc0064b0a/packages/dart_mappable_builder/lib/src/generators/mixins/decoding_mixin.dart#L11-L17
Indeed a bug, let me look into it.
If you were to declare a top level constant hook and use it. You will get a build time error. E.G.
There code here is not referring to the source code, it's referring to the code that dart_mappable created, before throwing it away once it detected a syntax error.
The issue here is that
const
should only appear when instantiating a Hook, not when referencing a constant.