Skip to content

feat: report incorrect padding instances #1392

@DavePearce

Description

@DavePearce

Summary

When a function is given with a padding instance that is not a valid instance of the function, then a useful error should be reported. Currently, an error is reported only during trace propagation and this is actually quite confusing.

Example

fn f(x u16) -> (y u16) {
   var c u1
   c,y = x + 1
   return
}

Then, with this trace:

{ "f" : { "x": [], "y": [] }}

We get the following error:

inconsistent instance f(0)=0 in trace (expected f(0)=1)

Approach

The approach is fairly straightforward. We just evaluate the padding instance during compilation and check the padding instance outputs match, at which point we can report a more useful error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions