-
Notifications
You must be signed in to change notification settings - Fork 144
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
Add RFC-1112 - "Obsolete allowed to use Obsolete" #617
Conversation
No distinction between whether the |
Good point. I will add info about it too |
- [ ] Approved in principle | ||
- [ ] [Implementation](https://github.com/dotnet/fsharp/pull/FILL-ME-IN) | ||
- [ ] Design Review Meeting(s) with @dsyme and others invitees | ||
- [Discussion](https://github.com/fsharp/fslang-design/discussions/FILL-ME-IN) |
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.
Missing discussion
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 I already should start one, since it's not yet approved
|
||
# Summary | ||
|
||
The general idea is to allow types and functions marked with `System.ObsoleteAttribute` to use other `Obsolete`-marked members without |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
If mentioning Modules separetely, then I guess i should add all combinations related to them to the Design section?
|
||
|
||
New text for the warning will indicate that the outer member should be marked `Obsolete`, like we do it | ||
with `async` in C#. For example, `The construct is deprecated and should not be used. Consider marking the outer function or type as Obsolete.` |
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.
Add the message from C#
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.
Why?
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.
Why should you expect everyone to be familiar with what C# does?
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's not essential to be familiar with it to understand the new text. But those who are familar will understand the analogy. But if necessary, I can add info about the C#'s message or remove the mention of C# completely
with `async` in C#. For example, `The construct is deprecated and should not be used. Consider marking the outer function or type as Obsolete.` | ||
|
||
# Drawbacks | ||
|
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.
Potential for abuse?
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 can't think of any potential for abuse at the moment. Let me know if there's some case
|
||
#### 5. IsError property effect | ||
|
||
* `Obsolete(_, (*IsError:*) true)` can use `Obsolete(_, (*IsError:*) true)` |
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.
You can use the named argument syntax
open System
[<Obsolete("", error=true)>] type A = A
Co-authored-by: Hadrian Tang <[email protected]>
Co-authored-by: Hadrian Tang <[email protected]>
Co-authored-by: Hadrian Tang <[email protected]>
@Happypig375 I added a comment about C# ignoring |
This is good enough for starting point, I like it, thanks |
@dsyme now I'd want to resolve the unresolved question and start working. Should there be something else done before I start? |
The behaviour should follow C# |
Feel free to start! I imagine it will be a matter or computing a flag and holding it in TcEnv, and propagating that through to AttributeChecking.fs |
It's not yet approved in principle, so I keep it as draft
Suggestion