Skip to content

Commit

Permalink
fix: op codes with no arguments and void return types were throwing `…
Browse files Browse the repository at this point in the history
…Not Supported: Calling void` error
  • Loading branch information
boblat committed Nov 5, 2024
1 parent d84d291 commit 6e5a095
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/awst_build/eb/op-module-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { SourceLocation } from '../../awst/source-location'
import { CodeError, InternalError } from '../../errors'
import { enumerate, invariant } from '../../util'
import type { IntrinsicOpGrouping, IntrinsicOpMapping } from '../op-metadata'
import { OP_METADATA } from '../op-metadata'
import { OP_METADATA, VOID_OPS } from '../op-metadata'
import type { PType } from '../ptypes'
import { IntrinsicEnumType, IntrinsicFunctionGroupType, IntrinsicFunctionType, stringPType } from '../ptypes'
import { typeRegistry } from '../type-registry'
Expand Down Expand Up @@ -33,7 +33,7 @@ export class IntrinsicOpGroupBuilder extends NodeBuilder {
}
const metaData = this.opGrouping.ops[name]

if (metaData.signatures.some((s) => s.argNames.length)) {
if (VOID_OPS.includes(metaData.op) || metaData.signatures.some((s) => s.argNames.length)) {
return new GroupedIntrinsicOpBuilder(sourceLocation, metaData)
}

Expand Down
2 changes: 2 additions & 0 deletions src/awst_build/op-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4774,3 +4774,5 @@ export const OP_METADATA: Record<string, IntrinsicOpMapping | IntrinsicOpGroupin
],
},
}

export const VOID_OPS = ['itxn_begin', 'itxn_next', 'itxn_submit']

0 comments on commit 6e5a095

Please sign in to comment.