Skip to content

Commit

Permalink
🐛 Remove collection length errors in nbt predicates (#1559)
Browse files Browse the repository at this point in the history
  • Loading branch information
misode authored Aug 6, 2024
1 parent 0c4e7ce commit 9ee9ba8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/nbt/src/checker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,15 @@ export function typeDefinition(
}
return []
},
reportError: mcdoc.runtime.checker.getDefaultErrorReporter(
ctx,
mcdoc.runtime.checker.getDefaultErrorRange<NbtNode>,
),
reportError: (error) => {
if (options.isPredicate && error.kind === 'invalid_collection_length') {
return
}
mcdoc.runtime.checker.getDefaultErrorReporter(
ctx,
mcdoc.runtime.checker.getDefaultErrorRange<NbtNode>,
)(error)
},
attachTypeInfo: (node, definition, desc = '') => {
node.typeDef = definition
node.requireCanonical = options.isPredicate
Expand Down

0 comments on commit 9ee9ba8

Please sign in to comment.