Skip to content

Commit

Permalink
Final response to Vineeth's review
Browse files Browse the repository at this point in the history
  • Loading branch information
brmataptos committed Sep 27, 2024
1 parent 2940f12 commit 61459eb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ Error: error[E04024]: invalid usage of function type
┌─ TEMPFILE:9:62
9 │ public fun for_each_ref<Element>(v: &vector<Element>, f: |&Element|) {
│ ^^^^^^^^^^ function type only allowed for inline function arguments
│ ^^^^^^^^^^ function-typed values only allowed for inline function arguments


Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,11 @@ impl<'a> RecursiveStructChecker<'a> {
struct_name,
struct_name,
);
self.mod_env
.env
.error_with_labels(&struct_env.get_loc(), "cyclic data", vec![(
field_env.get_loc().clone(),
note,
)]);
self.mod_env.env.error_with_labels(
&struct_env.get_loc(),
"cyclic data",
vec![(field_env.get_loc().clone(), note)],
);
}

/// Report cyclic dependency of structs
Expand Down Expand Up @@ -195,7 +194,7 @@ impl<'a> RecursiveStructChecker<'a> {
.iter()
.any(|ty| self.ty_contains_struct(path, ty, loc.clone(), struct_id, checked))
},
Type::Primitive(_) | Type::TypeParameter(_) => false,
Type::Primitive(_) | Type::TypeParameter(_) | Type::Fun(..) => false,
_ => panic!("ICE: {:?} used as a type parameter", ty),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,6 @@ impl ModuleGenerator {
}
},
Fun(_param_ty, _result_ty) => {
// let _param_ty = Box::new(self.signature_token(ctx, loc, param_ty));
// let _result_ty = Box::new(self.signature_token(ctx, loc, result_ty));
// TODO(LAMBDA)
ctx.error(
loc,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
error[E04007]: incompatible types
┌─ tests/move_check/typing/lambda_returning_lambda2.move:10:9
3 │ public inline fun foreach_caller2<T>(_v: &vector<T>, _action: ||(u64)) {
│ ----- Expected: 'u64'
·
10 │ foreach_caller2(&v, ||(|e| sum = sum + *e)) // expected to be not implemented
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
│ │ │
│ │ Given: '|&{integer}|()'
│ Invalid call of '0x8675309::M::foreach_caller2'. Invalid argument for parameter '_action'
warning[W09003]: unused assignment
┌─ tests/move_check/typing/lambda_returning_lambda2.move:9:13
9 │ let sum = 0;
│ ^^^ Unused assignment or binding for local 'sum'. Consider removing, replacing with '_', or prefixing with '_' (e.g., '_sum')

0 comments on commit 61459eb

Please sign in to comment.