Skip to main content

check_method_formals

Function check_method_formals 

Source
fn check_method_formals(parsed: &ParsedImpl) -> Result<()>
Expand description

Check the R formals of every generated method (check_r_formals), reserving the names each class system’s wrapper binds itself:

  • the receiver of an instance method: x for S3 and S4, the first dispatch argument (x unless s7(dispatch) or an operator says otherwise) for S7; shortcuts use the collision-free .mx_self;
  • self and private, which R6 binds inside initialize and every method of the class: the wrapper reads the pointer from private$.ptr and returns self from a chaining method.

Static methods and the other constructors are plain functions and reserve nothing; S7 property accessors have fixed formals, so a formal(...) on one is refused (#1842); vctrs impls take no instance methods (MXL120).