mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
add NoExpectation type error
This commit is contained in:
parent
ccd021a755
commit
2d1a1621c3
1 changed files with 17 additions and 1 deletions
|
@ -130,7 +130,23 @@ fn to_expr_report(
|
||||||
|
|
||||||
match expected {
|
match expected {
|
||||||
Expected::NoExpectation(expected_type) => {
|
Expected::NoExpectation(expected_type) => {
|
||||||
todo!("hit no expectation with type {:?}", expected_type)
|
let comparison = type_comparison(
|
||||||
|
found,
|
||||||
|
expected_type,
|
||||||
|
add_category(plain_text("It is"), &category),
|
||||||
|
plain_text("But you are trying to use it as:"),
|
||||||
|
Concat(vec![]),
|
||||||
|
);
|
||||||
|
|
||||||
|
Report {
|
||||||
|
filename,
|
||||||
|
title: "TYPE MISMATCH".to_string(),
|
||||||
|
text: Concat(vec![
|
||||||
|
plain_text("This expression is used in an unexpected way:"),
|
||||||
|
Region(expr_region),
|
||||||
|
comparison,
|
||||||
|
]),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Expected::FromAnnotation(name, _arity, annotation_source, expected_type) => {
|
Expected::FromAnnotation(name, _arity, annotation_source, expected_type) => {
|
||||||
use roc_types::types::AnnotationSource::*;
|
use roc_types::types::AnnotationSource::*;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue