Fix typo in variant name: Implicity -> Implicitly

This commit is contained in:
KtorZ 2023-01-19 17:26:33 +01:00
parent bb82b1bc1e
commit c5e876e817
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
2 changed files with 6 additions and 6 deletions

View File

@ -51,7 +51,7 @@ pub enum Error {
FunctionTypeInData { location: Span }, FunctionTypeInData { location: Span },
#[error("I found a discarded expression not bound to a variable.")] #[error("I found a discarded expression not bound to a variable.")]
ImplicityDiscardedExpression { location: Span }, ImplicitlyDiscardedExpression { location: Span },
#[error("I saw a {} fields in a context where there should be {}.\n", given.purple(), expected.purple())] #[error("I saw a {} fields in a context where there should be {}.\n", given.purple(), expected.purple())]
IncorrectFieldsArity { IncorrectFieldsArity {
@ -375,7 +375,7 @@ impl Diagnostic for Error {
Self::DuplicateName { .. } => Some(Box::new("duplicate_name")), Self::DuplicateName { .. } => Some(Box::new("duplicate_name")),
Self::DuplicateTypeName { .. } => Some(Box::new("duplicate_type_name")), Self::DuplicateTypeName { .. } => Some(Box::new("duplicate_type_name")),
Self::FunctionTypeInData { .. } => Some(Box::new("function_type_in_data")), Self::FunctionTypeInData { .. } => Some(Box::new("function_type_in_data")),
Self::ImplicityDiscardedExpression { .. } => { Self::ImplicitlyDiscardedExpression { .. } => {
Some(Box::new("implicitly_discarded_expr")) Some(Box::new("implicitly_discarded_expr"))
} }
Self::IncorrectFieldsArity { .. } => Some(Box::new("incorrect_fields_arity")), Self::IncorrectFieldsArity { .. } => Some(Box::new("incorrect_fields_arity")),
@ -494,7 +494,7 @@ impl Diagnostic for Error {
Self::FunctionTypeInData { .. } => Some(Box::new("Data types can't have functions in them due to how Plutus Data works.")), Self::FunctionTypeInData { .. } => Some(Box::new("Data types can't have functions in them due to how Plutus Data works.")),
Self::ImplicityDiscardedExpression { .. } => Some(Box::new(formatdoc! { Self::ImplicitlyDiscardedExpression { .. } => Some(Box::new(formatdoc! {
r#"A function can contain a sequence of expressions. However, any expression but the last one must be assign to a variable using the {let_keyword} keyword. If you really wish to discard an expression that is unused, you can prefix its name with '{discard}'. r#"A function can contain a sequence of expressions. However, any expression but the last one must be assign to a variable using the {let_keyword} keyword. If you really wish to discard an expression that is unused, you can prefix its name with '{discard}'.
"# "#
, let_keyword = "let".yellow() , let_keyword = "let".yellow()
@ -1162,7 +1162,7 @@ impl Diagnostic for Error {
vec![LabeledSpan::new_with_span(None, *location)].into_iter(), vec![LabeledSpan::new_with_span(None, *location)].into_iter(),
)), )),
Self::ImplicityDiscardedExpression { location, .. } => Some(Box::new( Self::ImplicitlyDiscardedExpression { location, .. } => Some(Box::new(
vec![LabeledSpan::new_with_span(None, *location)].into_iter(), vec![LabeledSpan::new_with_span(None, *location)].into_iter(),
)), )),
Self::IncorrectFieldsArity { location, .. } => Some(Box::new( Self::IncorrectFieldsArity { location, .. } => Some(Box::new(
@ -1298,7 +1298,7 @@ impl Diagnostic for Error {
Self::DuplicateName { .. } => None, Self::DuplicateName { .. } => None,
Self::DuplicateTypeName { .. } => None, Self::DuplicateTypeName { .. } => None,
Self::FunctionTypeInData { .. } => None, Self::FunctionTypeInData { .. } => None,
Self::ImplicityDiscardedExpression { .. } => None, Self::ImplicitlyDiscardedExpression { .. } => None,
Self::IncorrectFieldsArity { .. } => Some(Box::new( Self::IncorrectFieldsArity { .. } => Some(Box::new(
"https://aiken-lang.org/language-tour/custom-types", "https://aiken-lang.org/language-tour/custom-types",
)), )),

View File

@ -193,7 +193,7 @@ impl<'a, 'b> ExprTyper<'a, 'b> {
fn assert_assignment(&self, expr: &TypedExpr) -> Result<(), Error> { fn assert_assignment(&self, expr: &TypedExpr) -> Result<(), Error> {
if !matches!(*expr, TypedExpr::Assignment { .. }) { if !matches!(*expr, TypedExpr::Assignment { .. }) {
return Err(Error::ImplicityDiscardedExpression { return Err(Error::ImplicitlyDiscardedExpression {
location: expr.location(), location: expr.location(),
}); });
} }