Based on the feedback here: https://github.com/realm/realm-cocoa/issues/6459#issuecomment-603924744
- Added back the "dynamic" keyword
- Changed how type variable is set
Based on the feedback here: https://github.com/realm/realm-cocoa/issues/6459#issuecomment-603924744