1. Nicholas Tung
  2. sketch-frontend
  3. Issues
Issue #83 new

unsupported implicit cast causes hard-to-understand error message

Nicholas Tung
repo owner created an issue

=== failing sketch

We support upcasting of integers to arrays like so,

{{{ int[N] a = 0; }}}

but not as function call arguments,

{{{ void f(int[N] a) { } f(0); }}}

Minimal example to reproduce,

{{{ void f(int[4] a) { if (??) { a[0] += 1; } } harness void main() { f(0); } }}}

=== cryptic error message

the error message says

{{{ Caused by: java.lang.AssertionError at sketch.compiler.passes.lowering.FunctionParamExtension$ParameterCopyResolver.visitStmtAssign(FunctionParamExtension.java:104) at sketch.compiler.ast.core.stmts.StmtAssign.accept(StmtAssign.java:103) at sketch.compiler.ast.core.FEReplacer.doStatement(FEReplacer.java:153) at sketch.compiler.ast.core.FEReplacer.visitStmtBlock(FEReplacer.java:493) }}}

this is unreadable

=== other info

sketch revision: <<changeset 64d7809e6d02>> for the frontend, bef73a6a633c for the backend

Comments (0)

  1. Log in to comment