-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More errors #90
base: rewrite
Are you sure you want to change the base?
More errors #90
Conversation
This reverts commit 7e89158.
zapc/src/hir_builder/decl.rs
Outdated
if word == "server" || word == "client" { | ||
self.report(Report::ExpectedValueWrongType { | ||
value_span: words.first().unwrap().span().merge(words.last().unwrap().span()), | ||
expected_values: "\"client\" or \"server\"".to_string(), | ||
found_type: "path".to_string(), | ||
help: Some("add quotes to turn the path into a string".to_string()), | ||
}); | ||
|
||
return HirEventSource::Server; | ||
} else if word == "Server" || word == "client" { | ||
self.report(Report::ExpectedValueWrongType { | ||
value_span: words.first().unwrap().span().merge(words.last().unwrap().span()), | ||
expected_values: "\"client\" or \"server\"".to_string(), | ||
found_type: "path".to_string(), | ||
help: Some("lowercase the word and add quotes to turn the path into a string".to_string()), | ||
}); | ||
|
||
return HirEventSource::Server; | ||
} | ||
} else { | ||
// todo: report error | ||
} | ||
|
||
self.report(Report::ExpectedValueWrongType { | ||
value_span: words.first().unwrap().span().merge(words.last().unwrap().span()), | ||
expected_values: "\"client\" or \"server\"".to_string(), | ||
found_type: "path".to_string(), | ||
help: None, | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will almost certainly not reuse ExpectedValueWrongType
, so I think it would be a better idea to create a more specific report variant for this case.
zapc/src/hir_builder/ty.rs
Outdated
if generics.len() > 1 { | ||
// todo: report extra generics | ||
self.report(Report::IncorrectGenericCount { | ||
type_span: segment.span(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this wouldn't be the span of the entire type
imagine the type buffer<a, b>
- this would only be the span for buffer
when you really want it to be the span for the whole type
CI was failing because of Rustfmt. It wasn't a file I touched but I formatted it anyways. |
No description provided.