-
Notifications
You must be signed in to change notification settings - Fork 164
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
Resolve for typedefs/aliases and records in typeArguments
& resolve duplicate typedefs
#776
Conversation
CC @mosuem |
typeArguments
typeArguments
It seems that the bulk of this code is rely on |
Could this be cherrypicked into a 5.4.5 release? |
CI is broken on the entire repo as dart stable does not support |
typeArguments
typeArguments
& allow resolve typedefs
typeArguments
& allow resolve typedefstypeArguments
& resolve duplicate typedefs
@mosuem |
I don't mind at all, but I am also not a maintainer of this repo and maybe not the right person to ping ;) I just stumbled across the same CI error in dart-lang/test#2293 |
Maybe @srawlins wants to take a look (I hope he you don't mind the ping). I am fine refiling the PR to move to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much! I left a few notes but generally the fix is gold 😁
test/builder/auto_mocks_test.dart
Outdated
@@ -3553,6 +3553,64 @@ void main() { | |||
expect(mocksContent, contains('class MockBaz extends _i1.Mock')); | |||
expect(mocksContent, contains('implements _i2.Baz')); | |||
}); | |||
|
|||
test('when its a type parameter of function which returns another type', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean here by "a type parameter of function which returns another type." In this test case, the typedef appears to only be used as a type argument in a class definition class Foo extends BaseFoo<CreateBar>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about?
typedef mocks are generated properly when it\'s a function which returns any type
In this instance, Bar
was being ignored becuase the return type of CreateBar
want being resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That SG, thanks!
@mosuem I love a friendly ping 😁 I am fine doing whatever procedure works best for you, migrating to dart-lang/test. I think a git commit can be wired up that attributes the fix to @dickermoshe still... For external PRs like this, I think I've been able to just hand-copy the PR, once landed, into google3, and then re-export. But there might be a good copybara mechanism for that, at this point... |
I'll have to check the copybara settings, but normally even g3 SoT repos should be able to accept Github PRs. We can probably copy the config from package:intl, then it should just work. |
But please go ahead with merging this, any infra work can wait, features are much nicer ;) |
Thanks for the timely response. This is the coolest library ever, thank so much! |
Sorry for the delay, we're shipping a big change to the analyzer element model, and analyzer 7.0.0 just dropped. I think we have to do some cleanup on our side before landing this. Hopefully this week. 🤞 I'll stay in touch. |
OK we should be good to go. Ship it! |
…uplicate typedefs #776 Closes: #775 Closes: #777 Closes: #778 The fix for these issues is closely related so I've done both of them in a single PR. - Mockito wasn't checking for typedefs/aliases in `typeArguments` - it also wasn't looking into records on type args. - Typedefs which had the same underlying type were ignored even if the typedef had a different name These issues cause the dreaded `is missing from the asset URI mapping` error. See the related issue for a repro of each of these. I've also added regression tests for all of these. PiperOrigin-RevId: 702712435
…uplicate typedefs dart-lang/mockito#776 Closes: dart-lang/mockito#775 Closes: dart-lang/mockito#777 Closes: dart-lang/mockito#778 The fix for these issues is closely related so I've done both of them in a single PR. - Mockito wasn't checking for typedefs/aliases in `typeArguments` - it also wasn't looking into records on type args. - Typedefs which had the same underlying type were ignored even if the typedef had a different name These issues cause the dreaded `is missing from the asset URI mapping` error. See the related issue for a repro of each of these. I've also added regression tests for all of these. PiperOrigin-RevId: 702712435
Closes: #775
Closes: #777
Closes: #778
The fix for these issues is closely related so I've done both of them in a single PR.
typeArguments
These issues cause the dreaded
is missing from the asset URI mapping
error.See the related issue for a repro of each of these. I've also added regression tests for all of these.
Looking forward to a swift review!
Contribution guidelines:
dart format
.Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.