Skip to content

Missing Invariant Checks for Casts #148

@DavePearce

Description

@DavePearce

Test 000908 reports the wrong error:

type i8 is (int x) where (x >= -128) && (x <= 127)

function f(int x) -> i8[]
requires (x == 0) || (x == 256):
    return [(i8) x]

The error is:

src/main.whiley:5: postcondition may not be satisfied
    return [(i8) x]
    ^^^^^^^^^^^^^^^

But it should be complaining about the cast.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions