E1128: role method implementation drops realtime

View source

When a role method is marked meta realtime, every implementation must be marked too.

When a role method is marked meta realtime, every implementation must be marked too. A caller of the role relies on the promise, and an implementation without it would break the promise behind the role (ADR-0094). The error points at the method in the perform block.

Example

actus
struct File {
    value: Int,
}

role Writer {
    meta realtime
    verb write(abs self: File) -> Int;
}

perform Writer for File {
    verb write(abs self: File) -> Int {
        return self.value;
    }
}

verb main() {
}

Fix

Mark the implementation meta realtime. It is then checked by the realtime rules.

actus
struct File {
    value: Int,
}

role Writer {
    meta realtime
    verb write(abs self: File) -> Int;
}

perform Writer for File {
    meta realtime
    verb write(abs self: File) -> Int {
        return self.value;
    }
}

verb main() {
}

Run actus explain E1128 in your terminal to read this entry offline. Browse Modules & rules or all error codes.