-
Notifications
You must be signed in to change notification settings - Fork 73
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
RedundantNewKeyword is raised on a type inheriting from an interface that inherits IDisposable #572
Comments
Yes, that may be a workaround, but the F# Style Guide, and even the F# compiler, wants the |
Interestingly, there's this function:
which suggests that this check was actually enabled, but apparently doesn't quite find whether the interface is there. |
Might be related to how it is inside of an upcast expression ? I've added a test for that case, but it passes 👀 event without my modifications. I'll investigate a bit maybe next week, I'll temporarily disable it in my projects for the moment |
Could not reproduce this bug with or without upcast. If type implements |
Hey jp-fournier-dev, thanks for reporting this issue. I couldn't reproduce what you found (see this commit where I've added a test with your code snippet, and check that CI status It would be great if you provide us with more details or even a failure test. |
Description
Given the following code :
Considering that the type is a disposable through the
ISomeInterfaceWithDisposable
interface, my expectations is that this needs anew
keyword.Repro steps
Run FSharpLint on the following code with 0.21.3
Expected behavior
The redundant key word error to not be raised (this is what I would expect)
Actual behavior
The redundant key word error is raised
Known workarounds
Remove the
new
keyword from all occurence of this pattenrRelated information
Issue occurs on 0.21.3
Doesn't occur on 0.21.2
Windows 10
dotnet 6
The text was updated successfully, but these errors were encountered: