Skip to content

Commit

Permalink
Improve Path parsing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MateuszKubuszok committed Sep 15, 2023
1 parent 15a7f2c commit 2af6c99
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,17 @@ private[compiletime] trait Configurations { this: Derivation =>
@scala.annotation.nowarn("msg=Unreachable case")
private def extractPath[Field <: runtime.Path: Type]: String = Type[Field] match {
case ChimneyType.Path.Select(fieldName, path) if path.value =:= ChimneyType.Path.Root =>
fieldName.value.extractStringSingleton
import fieldName.Underlying as FieldName, path.Underlying as Path
Type[Path] match {
case root if root =:= ChimneyType.Path.Root => Type[FieldName].extractStringSingleton
case _ =>
// $COVERAGE-OFF$
reportError(s"Nested paths ${Type.prettyPrint[Field]} are not supported!!")
// $COVERAGE-ON$
}
case _ =>
// $COVERAGE-OFF$
reportError(s"Nested paths ${Type.prettyPrint[Field]} are not supported!!")
reportError(s"Bad paths shape ${Type.prettyPrint[Field]}!!")
// $COVERAGE-ON$
}
}
Expand Down

0 comments on commit 2af6c99

Please sign in to comment.