From 16169a387d80091fa10e79cee15b5b60dfe3bead Mon Sep 17 00:00:00 2001 From: Mingun Date: Sat, 5 Dec 2020 18:07:48 +0500 Subject: [PATCH] Fix incorrect reported path for switch types when validating types This change requires corresponding change in kaitai_struct_tests repository --- .../scala/io/kaitai/struct/precompile/TypeValidator.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared/src/main/scala/io/kaitai/struct/precompile/TypeValidator.scala b/shared/src/main/scala/io/kaitai/struct/precompile/TypeValidator.scala index 036fcbceb..1ab631a04 100644 --- a/shared/src/main/scala/io/kaitai/struct/precompile/TypeValidator.scala +++ b/shared/src/main/scala/io/kaitai/struct/precompile/TypeValidator.scala @@ -168,7 +168,9 @@ class TypeValidator(specs: ClassSpecs, topClass: ClassSpec) extends PrecompileSt } else { None } - val problems2 = validateDataType(caseType, casePath) + // All properties of types is declared on the common level for all variants so + // we don't use `casePath` here + val problems2 = validateDataType(caseType, path) problems1 ++ problems2 } }