Skip to content

Use "reasonable excuse" idea for unsafe functions. #129

@mlutze

Description

@mlutze

Flix will be removing the @Unsafe annotation. I propose we change our functions that use@Unsafe to instead use what I call the "reasonable excuse" model:

We add a new string parameter in which the user has to explain why what they are doing is safe. E.g.,

def unsafeGet(excuse: String, o: Option[a]): a = match o {
    case Some(x) => x
    case None => bug!("This should never happen because: '${excuse}'")
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions