"This class is using a deprecated type of constructor"

Everytime I open a particular project I’m working on I’m getting the following warning about a deprecation:

This class is using a deprecated type of constructor. It is recommended that you update this.

The class in question (Transform) has four constructors (one private). Clicking “Resolve” in the dialog box doesn’t fix the issue on next launch. No warnings are displayed when I analyse the project. Personally, I don’t see an issue with any of the constructors. Here are the four method signatures:

Public Sub Constructor()
// This method has no code
End Sub
Private Sub Constructor(cost As Double, sint As Double, x As Double, y As Double)
  Self.Cost = cost
  Self.Sint = sint
  Self.X = x
  Self.Y = y
End Sub
Public Sub Constructor(t As PhysicsKit.Transform)
  Self.Cost = t.Cost
  Self.Sint = t.Sint
  Self.X = t.X
  Self.Y = t.Y
End Sub
Public Sub Constructor(vector As PhysicsKit.Vector2) 
  Var x As Double = vector.X
  Var y As Double = vector.Y
  vector.X = Self.Cost * x - Self.Sint * y + Self.X
  vector.Y = Self.Sint * x + Self.Cost * y + Self.Y
End Sub

Any idea why I’m getting an error on launch?

That warning is usually a result of having a method with the same name as the class - or the old style constructor

1 Like

I think you’re right there - I do have that setup.

Hmm, I’ll finish the port and then rename it I guess.

Oh I’m quite certain I’m right about this
I wrote the code that detects it :stuck_out_tongue:

1 Like

Ha. Of course you did! :man_facepalming:

1 Like