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

Double deprecation when expanding def #12010

Open
HertzDevil opened this issue Apr 19, 2022 · 0 comments
Open

Double deprecation when expanding def #12010

HertzDevil opened this issue Apr 19, 2022 · 0 comments

Comments

@HertzDevil
Copy link
Contributor

If a call to a deprecated method requires a def expansion, the expanded def might produce its own deprecation warning. For example, it happens with default arguments:

@[Deprecated]
def test(x, y = 0)
end

test 1
In test.cr:5:1

 5 | test 1
     ^---
Warning: Deprecated top-level test.

In test.cr:2:1

 2 | def test(x, y = 0)
     ^---
Warning: Deprecated top-level test.

A total of 2 warnings were found.

and with out-of-order named arguments:

@[Deprecated]
def test(x, y)
end

test y: 1, x: 2
In test.cr:5:1

 5 | test y: 1, x: 2
     ^---
Warning: Deprecated top-level test:y:x.

In test.cr:2:1

 2 | def test(x, y)
     ^---
Warning: Deprecated top-level test.

A total of 2 warnings were found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant