refactor: remove pattern match in for comprehension
This commit is contained in:
@@ -82,11 +82,7 @@ def frontend(
|
||||
(prog, renameErrors) <- renamer.rename(partialProg)
|
||||
_ = errors.addAll(renameErrors.toList)
|
||||
typedProg = typeChecker.check(prog, errors)
|
||||
|
||||
res = NonEmptyList.fromList(errors.result) match {
|
||||
case Some(errors) => Left(errors)
|
||||
case None => Right(typedProg)
|
||||
}
|
||||
res = errors.result.toNel.toLeft(typedProg)
|
||||
} yield res
|
||||
}
|
||||
|
||||
|
||||
@@ -283,7 +283,6 @@ object renamer {
|
||||
allErrors <- toRename
|
||||
.zip(scope.subscopes(toRename.size))
|
||||
.parFoldMapA(renameFunction)
|
||||
// .map(x => x.combineAll)
|
||||
} yield (Program(chunks.toList, main.body)(main.pos), globalErrors ++ allErrors)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user