Skip to content

fix(cdk/testing): require at least one argument locator functions #23384

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

Closed
wants to merge 1 commit into from

Conversation

crisbeto
Copy link
Member

Currently the locator functions are written with a single rest parameter which means that no arguments can be passed as well, even though it'll result in an error at runtime.

These changes rework the type so that at least one argument is required to be passed in.

Currently the locator functions are written with a single rest parameter which means that no arguments can be passed as well, even though it'll result in an error at runtime.

These changes rework the type so that at least one argument is required to be passed in.
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Aug 16, 2021
@crisbeto crisbeto requested a review from mmalerba August 16, 2021 19:48
@crisbeto crisbeto requested review from devversion and a team as code owners August 16, 2021 19:48
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 16, 2021
Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

Nice! Oh, CI is red?

@crisbeto
Copy link
Member Author

Yeah, looks like this doesn't handle mixed usages very well. I'll see if I can work around it.

@crisbeto crisbeto marked this pull request as draft August 16, 2021 20:12
@crisbeto
Copy link
Member Author

It looks like typing mixed arguments isn't possible :(. Closing the PR.

@crisbeto crisbeto closed this Aug 17, 2021
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 17, 2021
@mmalerba
Copy link
Contributor

@crisbeto
Copy link
Member Author

I just gave it a shot, but I'm not sure it's what we want either. We'd need to allow something like (A | B)[] for both the rest parameter and the first one, but it requires that the first one is A (number in this case).

@mmalerba
Copy link
Contributor

@crisbeto
Copy link
Member Author

Nice, that one works as expected! Here's a PR to implement it #23619.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants