speckleworks / SpeckleCore

Check a brand new Speckle at: https://github.com/specklesystems
https://speckle.systems
MIT License
38 stars 17 forks source link

Deserialization prioritizes wrong ToNative methods #125

Closed mishaelnuh closed 5 years ago

mishaelnuh commented 5 years ago

Step 0:

For example: for Floor, ToNative methods for Floor should be called before ToNative methods for SpeckleMesh.

Actual Behaviour

SpeckleCore searches through assemblies and then all relevant methods for all types within the assembly. This sometimes causes methods from base types to be called first.

https://github.com/speckleworks/SpeckleCore/blob/9545e96f04d85f46203a99c21c76eeea0ea03dae/SpeckleCore/Conversion/ConverterDeserialisation.cs#L57-L68

Affected Projects

Anything using SpeckleCore.

Proposed Solution (if any)

Reverse for loop order.