(
}
// Second stage
- for (_idx, item) in items.iter().enumerate() {
+ for item in items {
match item {
StatementOrDeclaration::Statement(stmt) => {
if let Statement::VarVariable(_) = stmt {
diff --git a/checker/src/synthesis/mod.rs b/checker/src/synthesis/mod.rs
index b36083b5..d0d38fe8 100644
--- a/checker/src/synthesis/mod.rs
+++ b/checker/src/synthesis/mod.rs
@@ -33,81 +33,6 @@ use self::{
type_annotations::synthesise_type_annotation,
};
-pub(super) fn parser_property_key_to_checker_property_key<
- P: parser::property_key::PropertyKeyKind,
- T: crate::ReadFromFS,
->(
- property_key: &ParserPropertyKey,
- environment: &mut Environment,
- checking_data: &mut CheckingData,
-) -> PropertyKey<'static> {
- match property_key {
- ParserPropertyKey::StringLiteral(value, ..) | ParserPropertyKey::Ident(value, ..) => {
- PropertyKey::String(std::borrow::Cow::Owned(value.clone()))
- }
- ParserPropertyKey::NumberLiteral(number, _) => {
- let result = f64::try_from(number.clone());
- match result {
- Ok(v) => {
- // TODO is there a better way
- #[allow(clippy::float_cmp)]
- if v.floor() == v {
- PropertyKey::from_usize(v as usize)
- } else {
- // TODO
- PropertyKey::String(std::borrow::Cow::Owned(v.to_string()))
- }
- }
- // TODO
- Err(()) => todo!(),
- }
- }
- ParserPropertyKey::Computed(expression, _) => {
- let key_type =
- synthesise_expression(expression, environment, checking_data, TypeId::ANY_TYPE);
- PropertyKey::from_type(key_type, &checking_data.types)
- }
- }
-}
-
-impl From<(parser::ParseError, SourceId)> for Diagnostic {
- fn from(parse_error: (parser::ParseError, SourceId)) -> Self {
- Diagnostic::Position {
- reason: parse_error.0.reason,
- position: parse_error.0.position.with_source(parse_error.1),
- kind: crate::diagnostics::DiagnosticKind::Error,
- }
- }
-}
-
-pub enum Performs<'a> {
- Block(&'a parser::Block),
- Const(String),
- None,
-}
-
-impl crate::GenericTypeParameter for parser::GenericTypeConstraint {
- fn get_name(&self) -> &str {
- self.name()
- }
-}
-
-impl<'a> From