Skip to content

Commit

Permalink
Merge branch 'main' into mobxjsgh-1010
Browse files Browse the repository at this point in the history
  • Loading branch information
amondnet authored Oct 26, 2024
2 parents a324c77 + ff616d9 commit a3a2b00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions mobx_codegen/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

- Fixes [error with code generation when file has unnamed extension](https://github.com/mobxjs/mobx.dart/issues/1010) by [@amondnet](https://github.com/amondnet) in [#1020](https://github.com/mobxjs/mobx.dart/pull/1020)

## 2.6.1+1

- Fixing some analyzer errors related to deprecated types.

## 2.6.1

- Upgrading packages and sdk
Expand Down
5 changes: 4 additions & 1 deletion mobx_codegen/lib/src/type_names.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class LibraryScopedNameFinder {
// Reverse each import's export namespace so we can map elements to their
// library-local names. Note that the definedNames include a prefix if there
// is one.
// ignore: deprecated_member_use
for (final import in library.libraryImports) {
for (final entry in import.namespace.definedNames.entries) {
_namesByElement[entry.value] = entry.key;
Expand Down Expand Up @@ -79,6 +80,7 @@ class LibraryScopedNameFinder {
// If we're dealing with a typedef, we let it undergo the standard name
// lookup. Otherwise, we special case the function naming.
if (type.alias?.element is TypeAliasElement) {
// ignore: deprecated_member_use
typeElement = type.alias!.element.aliasedElement?.enclosingElement;
} else {
return _getFunctionTypeName(type);
Expand All @@ -88,7 +90,8 @@ class LibraryScopedNameFinder {
typeElement == null ||
// This is a bare type param, like "T"
type is TypeParameterType) {
return type.getDisplayString();
// ignore: deprecated_member_use
return type.getDisplayString(withNullability: true);
}

return _getNamedElementTypeName(typeElement!, type);
Expand Down

0 comments on commit a3a2b00

Please sign in to comment.