E4121#
The attribute (!, ?, !! mark) cannot be used on this application.
This error occurs when:
The attribute (
!,?,!!mark) is used on a constructor.The attribute is used on a function that does not fit.
!must be used only on an application that raises or is async.!!must be used only on an async application.
Erroneous example#
///|
pub enum Err {
IntErr(Int)
}
///|
fn square(x : Int) -> Int {
x * x
}
///|
pub fn invalid_attribute() -> Unit {
square!!(1) |> ignore()
// Error: The attribute `!!` cannot be used on application that does not raise
// errors.
}
Suggestion#
Remove the attribute (!, ?, !! mark) from the application.
///|
pub enum Err {
IntErr(Int)
}
///|
fn square(x : Int) -> Int {
x * x
}
///|
pub fn constructor_value() -> Err {
IntErr(1)
}
///|
pub fn square_value() -> Int {
square(2)
}