Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Lara-JS/src-api/lara/pass/SimplePass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,21 @@ export default abstract class SimplePass extends Pass {
}

/**
* Apply tranformation to
* Apply tranformation to matching joinpoints
*
* @param $jp - Joinpoint on which the pass will be applied
* @param data - Optional data that may be needed to perform the transformation
* @returns Results of applying this pass to the given joinpoint
*/
_apply_impl($jp: LaraJoinPoint): AggregatePassResult {
_apply_impl($jp: LaraJoinPoint, data?: any): AggregatePassResult {
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The base class Pass defines _apply_impl as _apply_impl($jp: LaraJoinPoint): PassResult, which does not include the optional data parameter. This creates a signature mismatch where SimplePass._apply_impl has an additional optional parameter that the base class does not support. Since Pass.apply() (line 33 in Pass.ts) calls this._apply_impl($actualJp) with only one argument, the data parameter will never be passed through the normal flow. Consider also updating the base class Pass to support the optional data parameter, or provide an alternative method to pass data to the transformation.

Copilot uses AI. Check for mistakes.
const matchingJps = this._selectedJps($jp).filter(($jp) =>
this.matchJoinpoint($jp)
);

const aggResult = new AggregatePassResult(this, $jp);
for (const $jp of matchingJps) {
try {
const result = this.transformJoinpoint($jp);
const result = this.transformJoinpoint($jp, data);
aggResult.pushResult(result);
} catch (e) {
if (e instanceof PassTransformationError) {
Expand All @@ -97,7 +98,8 @@ export default abstract class SimplePass extends Pass {
* Transformation to be applied to matching joinpoints
*
* @param $jp - Join point to transform
* @param data - Optional data that may be needed to perform the transformation
* @returns The result of the transformation
*/
abstract transformJoinpoint($jp: LaraJoinPoint): PassResult | never;
abstract transformJoinpoint($jp: LaraJoinPoint, data?: any): PassResult | never;
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The AdapterPass class, which extends SimplePass, needs to be updated to match the new signature. The transformJoinpoint method in AdapterPass.ts (line 66-69) only accepts $jp parameter, but the abstract method now requires an optional data parameter. This will cause a TypeScript compilation error or type mismatch.

Copilot uses AI. Check for mistakes.
}