shamblett / coap

A Coap package for dart
Other
16 stars 13 forks source link

missmatched type in auto-generated config.dart file #34

Closed Sorunome closed 2 years ago

Sorunome commented 2 years ago
lib/src/config/coap_config.dart:15:13: Error: The field 'CoapConfig.spec' has type 'CoapISpec', which does not match the corresponding type, 'CoapISpec?', in the overridden setter, 'DefaultCoapConfig.spec'.
 - 'CoapISpec' is from 'package:coap/coap.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/coap-3.1.0/lib/coap.dart').
  CoapISpec spec;
            ^
../../../../../.pub-cache/hosted/pub.dartlang.org/coap-3.1.0/lib/src/coap_config.dart:23:14: Context: This is the overridden method ('spec').
  CoapISpec? spec;
             ^
lib/src/config/coap_config.dart:15:13: Error: Field 'spec' should be initialized because its type 'CoapISpec' doesn't allow null.
 - 'CoapISpec' is from 'package:coap/coap.dart' ('../../../../../.pub-cache/hosted/pub.dartlang.org/coap-3.1.0/lib/coap.dart').
  CoapISpec spec;
            ^^^^

it appears the code generator is missing a single ? for null safety

shamblett commented 2 years ago

Yep OK, I'll have a look at this.

shamblett commented 2 years ago

Hopefully fixed, package re published at version 3.1.1

Sorunome commented 2 years ago

yep, seems to be fixed now