Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to analyzer 1.1.0 #502

Closed
proninyaroslav opened this issue Mar 5, 2021 · 6 comments · Fixed by #462
Closed

Upgrade to analyzer 1.1.0 #502

proninyaroslav opened this issue Mar 5, 2021 · 6 comments · Fixed by #462

Comments

@proninyaroslav
Copy link

floor_generator 1.0.0-nullsafety.0 requires analyzer ^0.40.6.

@proninyaroslav
Copy link
Author

proninyaroslav commented Mar 5, 2021

I tried to use dependency_overrides: analyzer: ^ 1.1.0 and it doesn't seem to work as expected during build_runner:

[WARNING] stderr: ../../.pub-cache/hosted/pub.dartlang.org/floor_generator-1.0.0-nullsafety.0/lib/processor/database_processor.dart:115:48: Error: Property 'element' cannot be accessed on 'DartType?' because it is potentially null.
[WARNING] stderr:  - 'DartType' is from 'package:analyzer/dart/element/type.dart' ('../../.pub-cache/hosted/pub.dartlang.org/analyzer-1.1.0/lib/dart/element/type.dart').
[WARNING] stderr: Try accessing using ?. instead.
[WARNING] stderr:         ?.map((object) => object.toTypeValue().element)
[WARNING] stderr:                                                ^^^^^^^
[WARNING] stderr: ../../.pub-cache/hosted/pub.dartlang.org/floor_generator-1.0.0-nullsafety.0/lib/processor/database_processor.dart:139:52: Error: Property 'element' cannot be accessed on 'DartType?' because it is potentially null.
[WARNING] stderr:  - 'DartType' is from 'package:analyzer/dart/element/type.dart' ('../../.pub-cache/hosted/pub.dartlang.org/analyzer-1.1.0/lib/dart/element/type.dart').
[WARNING] stderr: Try accessing using ?. instead.
[WARNING] stderr:             ?.map((object) => object.toTypeValue().element)
[WARNING] stderr:                                                    ^^^^^^^
[WARNING] stderr: ../../.pub-cache/hosted/pub.dartlang.org/floor_generator-1.0.0-nullsafety.0/lib/misc/extension/type_converter_element_extension.dart:19:50: Error: Property 'element' cannot be accessed on 'DartType?' because it is potentially null.
[WARNING] stderr:  - 'DartType' is from 'package:analyzer/dart/element/type.dart' ('../../.pub-cache/hosted/pub.dartlang.org/analyzer-1.1.0/lib/dart/element/type.dart').
[WARNING] stderr: Try accessing using ?. instead.
[WARNING] stderr:           ?.map((object) => object.toTypeValue().element);
[WARNING] stderr:                                                  ^^^^^^^
[WARNING] stderr: ../../.pub-cache/hosted/pub.dartlang.org/floor_generator-1.0.0-nullsafety.0/lib/misc/extension/type_converter_element_extension.dart:50:41: Error: Property 'element' cannot be accessed on 'InterfaceType?' because it is potentially null.
[WARNING] stderr:  - 'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('../../.pub-cache/hosted/pub.dartlang.org/analyzer-1.1.0/lib/dart/element/type.dart').
[WARNING] stderr: Try accessing using ?. instead.
[WARNING] stderr:   bool get isTypeConverter => supertype.element.displayName == 'TypeConverter';
[WARNING] stderr:                                         ^^^^^^^
[WARNING] stderr: ../../.pub-cache/hosted/pub.dartlang.org/floor_generator-1.0.0-nullsafety.0/lib/processor/entity_processor.dart:58:14: Error: Method 'toStringValue' cannot be called on 'DartObject?' because it is potentially null.
[WARNING] stderr:  - 'DartObject' is from 'package:analyzer/dart/constant/value.dart' ('../../.pub-cache/hosted/pub.dartlang.org/analyzer-1.1.0/lib/dart/constant/value.dart').
[WARNING] stderr: Try calling using ?. instead.
[WARNING] stderr:             .toStringValue() ??
[WARNING] stderr:              ^^^^^^^^^^^^^
[WARNING] stderr: ../../.pub-cache/hosted/pub.dartlang.org/floor_generator-1.0.0-nullsafety.0/lib/processor/entity_processor.dart:137:52: Error: The argument type 'List<String?>' can't be assigned to the parameter type 'List<String>' because 'String?' is nullable and 'String' isn't.
[WARNING] stderr:  - 'List' is from 'dart:core'.
[WARNING] stderr:             throw _processorError.noMatchingColumn(values);
[WARNING] stderr:                                                    ^
[WARNING] stderr: ../../.pub-cache/hosted/pub.dartlang.org/floor_generator-1.0.0-nullsafety.0/lib/processor/entity_processor.dart:163:23: Error: A value of type 'List<String?>' can't be returned from a function with return type 'List<String>' because 'String?' is nullable and 'String' isn't.
[WARNING] stderr:  - 'List' is from 'dart:core'.
[WARNING] stderr:             .toList() ??
[WARNING] stderr:                       ^
[WARNING] stderr: ../../.pub-cache/hosted/pub.dartlang.org/floor_generator-1.0.0-nullsafety.0/lib/processor/entity_processor.dart:219:14: Error: Method 'toBoolValue' cannot be called on 'DartObject?' because it is potentially null.
[WARNING] stderr:  - 'DartObject' is from 'package:analyzer/dart/constant/value.dart' ('../../.pub-cache/hosted/pub.dartlang.org/analyzer-1.1.0/lib/dart/constant/value.dart').
[WARNING] stderr: Try calling using ?. instead.
[WARNING] stderr:             .toBoolValue() ??
[WARNING] stderr:              ^^^^^^^^^^^
[WARNING] stderr: ../../.pub-cache/hosted/pub.dartlang.org/floor_generator-1.0.0-nullsafety.0/lib/processor/type_converter_processor.dart:21:51: Error: Property 'typeArguments' cannot be accessed on 'InterfaceType?' because it is potentially null.
[WARNING] stderr:  - 'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('../../.pub-cache/hosted/pub.dartlang.org/analyzer-1.1.0/lib/dart/element/type.dart').
[WARNING] stderr: Try accessing using ?. instead.
[WARNING] stderr:     final typeArguments = _classElement.supertype.typeArguments;
[WARNING] stderr:                                                   ^^^^^^^^^^^^^
[WARNING] stderr: ../../.pub-cache/hosted/pub.dartlang.org/floor_generator-1.0.0-nullsafety.0/lib/processor/insertion_method_processor.dart:85:10: Error: Method 'toEnumValueString' cannot be called on 'DartObject?' because it is potentially null.
[WARNING] stderr:  - 'DartObject' is from 'package:analyzer/dart/constant/value.dart' ('../../.pub-cache/hosted/pub.dartlang.org/analyzer-1.1.0/lib/dart/constant/value.dart').
[WARNING] stderr: Try calling using ?. instead.
[WARNING] stderr:         .toEnumValueString();
[WARNING] stderr:          ^^^^^^^^^^^^^^^^^

@ervindobri
Copy link

I support this, can't use floor with google_fonts for this reason.
Can we expect a fix soon?

@vitusortner
Copy link
Collaborator

We're looking into it right now and we'll create a new release ASAP.

@proninyaroslav
Copy link
Author

Thank you, I hope for a quick release. Without this, I can't migrate my project to nullsafety.

@vitusortner
Copy link
Collaborator

vitusortner commented Mar 7, 2021

We just published the 1.0.0-nullsafety.1 release with support for Dart 2.12.0 and the latest analyzer version. We unluckily can't go stable as crucial dependencies haven't yet been migrated. If you encounter problems with 1.0.0-nullsafety.1, please raise a new issue on GitHub.

@proninyaroslav
Copy link
Author

Ok, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants