Skip to content
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

op2++: codegen for &self parameter #686

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

littledivy
Copy link
Member

Refactor out codegen for &self from #682

struct State {
  name: &'static str,
}

impl State {
  #[op2(fast, method(State)]
  fn print(&self) {
    println!("{}", self.name);
  }
}

const STATE_DECL: [OpDecl; 1] = [
  State::print()
];

@littledivy littledivy requested a review from mmastrac April 7, 2024 04:32
@@ -122,13 +122,14 @@ fn generate_op2(
zip(signature.args.iter(), &func.sig.inputs).collect::<Vec<_>>();

let mut args = vec![];
let mut needs_args = false;
let mut needs_args = config.method.is_some();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function callback arguments are needed for: args.this()

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 87.25490% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 81.29%. Comparing base (5245f5d) to head (4f95660).

Files Patch % Lines
testing/checkin/runner/ops.rs 0.00% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #686      +/-   ##
==========================================
+ Coverage   81.26%   81.29%   +0.02%     
==========================================
  Files          95       95              
  Lines       24295    24385      +90     
==========================================
+ Hits        19744    19823      +79     
- Misses       4551     4562      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mmastrac mmastrac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@littledivy littledivy merged commit 26880ec into denoland:main Apr 8, 2024
17 checks passed
@littledivy littledivy deleted the op2++_part_2 branch April 8, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants