Skip to content

Commit

Permalink
replace unsafe casts with @ts-expect-error, https://github.com/phetsi…
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Dec 11, 2023
1 parent 5c8c58f commit 3537850
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions js/pointslope/view/PointSlopeEquationNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,8 @@ export default class PointSlopeEquationNode extends EquationNode {
maxWidth: 200
}, providedOptions );

assert && assert( lineProperty.value instanceof Line );
return new PointSlopeEquationNode( lineProperty as Property<Line>, options );
// @ts-expect-error lineProperty is Property<Line> | Property<Line | NotALine>
return new PointSlopeEquationNode( lineProperty, options );
}
}

Expand Down
4 changes: 2 additions & 2 deletions js/slope/view/SlopeEquationNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ export default class SlopeEquationNode extends EquationNode {
maxWidth: 200
}, providedOptions );

assert && assert( lineProperty.value instanceof Line );
return new DynamicLabelNode( lineProperty as Property<Line>, options );
// @ts-expect-error lineProperty is Property<Line> | Property<Line | NotALine>
return new DynamicLabelNode( lineProperty, options );
}
}

Expand Down
4 changes: 2 additions & 2 deletions js/slopeintercept/view/SlopeInterceptEquationNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ export default class SlopeInterceptEquationNode extends EquationNode {
maxWidth: 200
}, providedOptions );

assert && assert( lineProperty.value instanceof Line );
return new SlopeInterceptEquationNode( lineProperty as Property<Line>, options );
// @ts-expect-error lineProperty is Property<Line> | Property<Line | NotALine>
return new SlopeInterceptEquationNode( lineProperty, options );
}
}

Expand Down

1 comment on commit 3537850

@pixelzoom
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please sign in to comment.