Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Model type inference errors in compiler source #9

Open
pierwill opened this issue Sep 22, 2022 · 0 comments
Open

Model type inference errors in compiler source #9

pierwill opened this issue Sep 22, 2022 · 0 comments

Comments

@pierwill
Copy link
Owner

/// Errors that can be returned during type inference.
/// (Note that these error messages are read by end users.
/// This should be kept in mind when returning one of these errors.)
#[derive(Clone, Debug, PartialEq)]
#[allow(missing_docs)]
pub enum Error {
    CannotUnify {
        exp: MonoType,
        act: MonoType,
    },
    CannotConstrain {
        exp: Kind,
        act: MonoType,
    },
    OccursCheck(Tvar, MonoType),
    MissingLabel(String),
    ExtraLabel(String),
    CannotUnifyLabel {
        lab: String,
        exp: MonoType,
        act: MonoType,
        cause: Box<Error>,
    },
    MissingArgument(String),
    ExtraArgument(String),
    CannotUnifyArgument(String, Box<Error>),
    CannotUnifyReturn {
        exp: MonoType,
        act: MonoType,
        cause: Box<Error>,
    },
    MissingPipeArgument,
    MultiplePipeArguments {
        exp: String,
        act: String,
    },
    NotALabel(MonoType),
}

https://github.com/influxdata/flux/blob/140a51b02f38c6b843499109f780f47326b9a1e9/libflux/flux-core/src/semantic/types.rs#L252-L289

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant