Skip to content

Commit

Permalink
CommonMethods + TypeDetector: handle ._io call on generic KaitaiStr…
Browse files Browse the repository at this point in the history
…uct objects properly
  • Loading branch information
GreyCat committed Mar 26, 2024
1 parent 4fdf4c0 commit 15959f0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ abstract trait CommonMethods[T] extends TypeDetector {
valType match {
case KaitaiStructType | CalcKaitaiStructType(_) =>
attr.name match {
case Identifier.PARENT => kaitaiStructField(value, attr.name)
case Identifier.PARENT | Identifier.IO => kaitaiStructField(value, attr.name)
}
case ut: UserType =>
userTypeField(ut, value, attr.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class TypeDetector(provider: TypeProvider) {
case KaitaiStructType | CalcKaitaiStructType(_) =>
attr.name match {
case Identifier.PARENT => CalcKaitaiStructType()
case Identifier.IO => KaitaiStreamType
case _ => throw new MethodNotFoundError(attr.name, valType)
}
case t: UserType =>
Expand Down

0 comments on commit 15959f0

Please sign in to comment.