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 prepare for Dart 3; use working uris when available #310

Merged
merged 10 commits into from
Feb 13, 2023

Conversation

eernstg
Copy link
Collaborator

@eernstg eernstg commented Feb 13, 2023

This PR deletes the legacy tests (they contain non-null-safe code and cannot be executed in the future). The PR also adjusts the SDK bounds in order to prepare for Dart 3.

The update revealed that one test, 'test_reflectable/test/new_instance_native_test.dart', performed a reflective invocation of the list constructor named List, which is no longer supported. The test was adjusted to call another constructor of List.

Finally, this PR changes the computation of the uri of a LibraryMirror such that it uses a package URI whenever possible. This should be helpful in the situation where there is a need to find the actual source code, as requested in #305.

The change in the result returned by the uri getter may seem like a breaking change, but it is hardly breaking in practice because the result returned previously was essentially meaningless (using the scheme reflectable which is not used anywhere else, and consisting mostly of a number which reflected the numbering of libraries being loaded by the analyzer during code generation).

The new behavior is tested in the updated version of 'reflect_type_test.dart'.

@eernstg eernstg requested a review from sigurdm February 13, 2023 14:49
Copy link
Collaborator

@sigurdm sigurdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a comment about the Urls...

@eernstg eernstg merged commit 122bd81 into master Feb 13, 2023
@eernstg eernstg deleted the use_working_uris_when_available_feb23 branch February 13, 2023 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants