Skip to content

Commit a70ac54

Browse files
committed
Cleanups
1 parent 1380c90 commit a70ac54

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Linter.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ import Types.*, Contexts.*, Symbols.*, Flags.*, Constants.*
77
import reporting.*
88
import Decorators.i
99

10+
/** A module for linter checks done at typer */
1011
object Linter:
1112
import ast.tpd.*
1213

1314
/** If -Wnonunit-statement is set, warn about statements in blocks that are non-unit expressions.
1415
* @return true if a warning was issued, false otherwise
1516
*/
16-
private[typer] def warnOnInterestingResultInStatement(t: Tree)(using Context): Boolean =
17+
def warnOnInterestingResultInStatement(t: Tree)(using Context): Boolean =
1718

1819
def isUninterestingSymbol(sym: Symbol): Boolean =
1920
sym == NoSymbol ||
@@ -68,6 +69,10 @@ object Linter:
6869
else false
6970
end warnOnInterestingResultInStatement
7071

72+
/** If -Wimplausible-patterns is set, warn about pattern values that can match the scrutinee
73+
* type only if there would be some user-defined equality method that equates values of the
74+
* two types.
75+
*/
7176
def warnOnImplausiblePattern(pat: Tree, selType: Type)(using Context): Unit =
7277
// approximate type params with bounds
7378
def approx = new ApproximatingTypeMap {

0 commit comments

Comments
 (0)