Skip to content

Commit 32644de

Browse files
committed
lil enhancement
1 parent da13377 commit 32644de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

analyzer/src/main/scala/com/avsystem/commons/analyzer/ThrownExceptionNotInFunction.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ final class ThrownExceptionNotInFunction(g: Global) extends AnalyzerRule(g, "thr
88
import global.*
99

1010
def analyze(unit: CompilationUnit): Unit = unit.body.foreach(analyzeTree {
11-
case Apply(f: TypeApply, args: List[Tree]) =>
11+
case Apply(f: Tree, args: List[Tree]) =>
1212
args.zip(f.tpe.params).foreach {
13-
case (arg: Throw, param) if definitions.isFunctionType(param.tpe) =>
13+
case (arg, param) if definitions.isFunctionType(param.tpe) && arg.tpe <:< definitions.NothingTpe =>
1414
report(arg.pos, "exception thrown in place of function definition")
1515
case (_, _) =>
1616
}

0 commit comments

Comments
 (0)