Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are plenty of cases where Disposables are used in non-simple scopes enabled by using statements, and where it is better to call dispose explicitly rather than using an explicit using statement.


No doubt, though I would argue those are the exception rather than the rule... which is why it should be an ignorable warning, preferably requiring a code annotation to turn it off. But it absolutely be something a modern IDE should flag as a potential error (IntelliJ, for example, has whole classes of these types of inspections for Java, Kotlin, etc).


If the false positive rate was even just 1 or 2%, it might be too noisy to warn about. Perhaps an annotation to opt out would be more apt.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: