simc / crimson

Fast, efficient and easy-to-use JSON parser and serializer for Dart.
Apache License 2.0
229 stars 6 forks source link

`invalid_assignment` on bool when `strict-casts: true` #22

Closed SunlightBro closed 1 year ago

SunlightBro commented 1 year ago

If the analysis_options.yaml enforces strict-casts for you project

include: package:flutter_lints/flutter.yaml

analyzer:
  language:
    strict-casts: true
    # 
    strict-inference: true
    strict-raw-types: true

The generated code for assigning a bool will have a invalid_assignment error

        case -6615550055289275125: // hello
          hello = read();
          break;
SunlightBro commented 1 year ago
analyzer:
  exclude:
    - "**/*.g.dart"