Matrix4x4.TRS broken with non-identity Scales?

I can’t imagine that something fundamental like this is bugged, so it must be my fault, but I don’t know what it is.

        Matrix4x4 test = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, Vector3.one);
        Debug.Log("trans: " + test.GetPosition());
        Debug.Log("rot: " + test.GetRotation().eulerAngles);
        Debug.Log("scale: " + test.GetScale());

results (correctly) in:
trans: (0.0, 0.0, 0.0)
rot: (0.0, 0.0, 0.0)
scale: (1.0, 1.0, 1.0)

but

        Matrix4x4 test = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(.5f,.5f,.5f));
        Debug.Log("trans: " + test.GetPosition());
        Debug.Log("rot: " + test.GetRotation().eulerAngles);
        Debug.Log("scale: " + test.GetScale());

results in:
trans: (0.0, 0.0, 0.0)
rot: (18.0, 58.3, 58.3) <----- (!!!)
scale: (0.5, 0.5, 0.5)

Am I being dumb here or is this busted?

I’m in Unity 5.5.1f1.

Thanks

Those methods you use on the matrix are not built in are they? At least they are not in the online documentation.
As far as I understand it is mathematically impossible to extract the rotation without knowing the scale from a matrix and vice versa, so I’m guessing the rotation extraction method assumes a uniform scale of 1.

Huh, that’s interesting. They (GetPosition/Rotation/Scale) seem built in to me - I did not add them. I don’t know what method they are using but if there are no non-uniform scales/skews I think it should be mathematically possible to extract the rotation.

In any case I will have to doublecheck my code to see if my original failure case (before I created the test case I posted) relied on GetRotation not.