-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work ondevexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.linter-lint-proposallinter-status-pending
Description
Description
"The null value will never be passed to operator ==. Use a non-nullable Object parameter"
Details
A definition like bool operator ==(Object? other) causes other classes which override the interface to also accept a nullable argument, even though null will never be passed.
Kind
Style
Good Examples
@override
bool operator ==(Object other) =>Bad Examples
@override
bool operator ==(Object? other) =>Discussion
Mockito codegen currently fails to generate fakes for classes with a nullable argument to operator ==.
The main motivator is that the code is misleading - null can't show up so it's not worth making it look like it can.
srawlins
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work ondevexp-linterIssues with the analyzer's support for the linter packageIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.Use area-devexp instead.linter-lint-proposallinter-status-pending