-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
parser: ensure @[deprecated_after] works without @[deprecated] #25480
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
base: master
Are you sure you want to change the base?
Conversation
|
Connected to Huly®: V_0.6-26162 |
|
I think I'm against this. Since there is no message parameter for That means allowing The other alternative, of course, would be to support all the functionality in a single attribute. |
|
Yeah I don't disagree but in the current state we don't get any deprecation warning at all when using |
|
Coming back to this I think we have two options:
Which do we think is better? |
|
Personally, I'm all for a single |
|
I agree, I think we could even introduce a vmft that changes to the new syntax and it will end up not being too much work. |
|
I have a working concept that looks like this: @[deprecated: '2025-10-10 use new function instead']
fn d0() {}
@[deprecated: '1234567890']
fn d1() {}
@[deprecated: '']
fn d2() {}
@[deprecated: 'a']
fn d3() {}
@[deprecated: 'greater than 10 chars']
fn d4() {}
@[deprecated: '2025-10-10close']
fn d5() {}
@[deprecated: ' 2025-10-10']
fn d6() {}This would output: Another option is supporting multiple values in an attribute (which currently is not supported) like: @[deprecated: 'use d() instead', '2025-10-10'; noreturn]
fn d1() {
for {}
} |
a32cc36 to
ecb3435
Compare
|
If it can only have 1 parameter, I'd still like to see a separator between the date and msg: @[deprecated: '2025-10-14!message']doesn't have to be It would be handy if attributes worked similarly to functions with trailing struct literal parameters, so you could supply parameters by: all of them in order, none of them, supply in a different order by naming them, etc., etc. |
|
Yeah would be good to have this. Was thinking either a separator like Edit: |
ecb3435 to
6a0b15b
Compare
|
Pushed a version that uses |
|
Yes, they should be. There might not be a reason to give a message, just deprecation dates. |
|
Why did the deprecation date change from being the date of the end of support to the date of the start of the deprecation? (it is also a bit wierd because the date in the message is 2025 10 01 but in the code it is 2025 10 10l be an error after 2026-03-30) |
|
The date changed because nobody has seen the deprecation notice before, since it was ignored with only If the date was left the same, they would suddenly start getting a deprecation message, but it would also immediately be an ERROR instead of just a WARNING for the first 6 months (since that much time has already passed since the original date). And yes, it was decided that V would use a 6 month deprecation window. |
Fixes #25471.
Used to print:
Didn't add a test as this would change depending on the date which would be tricky.