-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[NotClientImplementable]
does not prevent builds
#15736
Comments
That's mostly by design, as we wanted to keep non-ref assemblies with no changes. Making it possible to access private APIs if needed (for example, if somebody writes a custom backend). But that's not ideal situation. Yes. Alternative idea was to use C# analyzers, which would work better in this scenario. But won't support F# or other non-C# languages. |
Personally, I think it's best to allow this usage. It's a good middle road: you get the warning telling you not to use the API. If you need it or know better you can override. |
I would be fine with that as well, but I'd expect an analyzer warning I can silence. With the current setup, Rider shows an error that I can't get rid of. |
As it should.
|
I think my gripe is that it's an error, not a warning. Yet, it still behaves like a warning. I'm fine with Rider flagging usage, but not in a way that abuses ref assemblies. For example, for #8266, I was told to try reimplementing Also, that property is not documented anywhere on the website. |
Correct. We don't want users to rely on this property, as these APIs are unstable and can break in minor releases. Still, this option exists. |
This is rather interesting. Previously Roslyn was using reference assemblies for compilation and the build would fail. |
Actually, CoreCompile is being fed with |
Describe the bug
Avalonia tags interfaces with
[NotClientImplementable]
to prevent downstream users from deriving their own classes. This produces an error in Rider, but not during builds.To Reproduce
Add the following class:
Expected behavior
A compiler error. Instead, it compiles fine despite the error in Rider.
Avalonia version
11.0.10
OS
No response
Additional context
The IL rewriter only patches up the "ref" assemblies. This causes errors in tools using them, but not during builds that use the normal assemblies.
Using dotPeek, I can confirm that
internal void (This interface or abstract class is -not- implementable by user code !)();
only exists in the "ref" assemblies, but is missing from the "lib" ones.~/.nuget/avalonia/11.0.10/lib/net6.0/Avalonia.Base.dll
~/.nuget/avalonia/11.0.10/ref/net6.0/Avalonia.Base.dll
My Implementation
The text was updated successfully, but these errors were encountered: