Skip to content

bug(get-theme-color): Function get-theme-color throws error with 4 arguments #29819

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
1 task
dinac1994 opened this issue Oct 3, 2024 · 1 comment · Fixed by #29994
Closed
1 task

bug(get-theme-color): Function get-theme-color throws error with 4 arguments #29819

dinac1994 opened this issue Oct 3, 2024 · 1 comment · Fixed by #29994
Assignees
Labels
area: material/core P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@dinac1994
Copy link

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

get-theme

Reproduction

Stackblitz doesn't include newest version of Angular Material (^18), so can't be produced.

Basically, an invocation of get-theme-color($theme, primary, neutral, 90) throws an error because it does not handle the case in which get-theme-color receives four arguments.

It can be seen in the picture below that, even though it is clear a function can expect 4 arguments ($theme and $args, where length of $args can be 3), the case for $args-count == 3 is not handled.

Image

Expected Behavior

Handle the case for $args-count == 3, so get-theme-color does not throw errors when it receives 4 arguments.

Actual Behavior

Function get-theme-color returns a following error:

Function finished without @return.

Environment

  • Angular: 18.2.6
  • CDK/Material: 18.2.6
  • Browser(s): all
  • Operating System (e.g. Windows, macOS, Ubuntu): all
@dinac1994 dinac1994 added the needs triage This issue needs to be triaged by the team label Oct 3, 2024
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/core and removed needs triage This issue needs to be triaged by the team labels Oct 9, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 10, 2024
Fixes that the `get-theme-color` function was incorrectly validating its number of arguments. We were always checking if the arguments are between 2 and 4, whereas it actually accepts either 2 or 3 for M3 themes and between 2 and 4 for M2 themes.

Fixes angular#29819.
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 10, 2024
Fixes that the `get-theme-color` function was incorrectly validating its number of arguments. We were always checking if the arguments are between 2 and 4, whereas it actually accepts either 2 or 3 for M3 themes and between 2 and 4 for M2 themes.

Fixes angular#29819.
@crisbeto crisbeto self-assigned this Nov 10, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 10, 2024
Fixes that the `get-theme-color` function was incorrectly validating its number of arguments. We were always checking if the arguments are between 2 and 4, whereas it actually accepts either 2 or 3 for M3 themes and between 2 and 4 for M2 themes.

Fixes angular#29819.
crisbeto added a commit that referenced this issue Nov 11, 2024
Fixes that the `get-theme-color` function was incorrectly validating its number of arguments. We were always checking if the arguments are between 2 and 4, whereas it actually accepts either 2 or 3 for M3 themes and between 2 and 4 for M2 themes.

Fixes #29819.

(cherry picked from commit fe631c5)
crisbeto added a commit that referenced this issue Nov 11, 2024
Fixes that the `get-theme-color` function was incorrectly validating its number of arguments. We were always checking if the arguments are between 2 and 4, whereas it actually accepts either 2 or 3 for M3 themes and between 2 and 4 for M2 themes.

Fixes #29819.

(cherry picked from commit fe631c5)
@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 Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/core P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants