GenericScriptableArchitecture icon indicating copy to clipboard operation
GenericScriptableArchitecture copied to clipboard

[EventReference] Error CS0173: Type of conditional expression cannot be determined because there is no implicit conversion between 'GenericScriptableArchitecture.ScriptableEvent' and 'GenericScriptableArchitecture.EventInstancer'

Open Walter-Hulsebos opened this issue 2 years ago • 2 comments

I've been receiving this error in a lot of places inside of EventReference

error CS0173: Type of conditional expression cannot be determined because there is no implicit conversion between 'GenericScriptableArchitecture.ScriptableEvent' and 'GenericScriptableArchitecture.EventInstancer'

It happens at (27, 43)

private IScriptableEvent Event => _eventType == EventType.ScriptableEvent ? _event : _eventInstancer;

(90, 46)

private IScriptableEvent<T> Event => _eventType == EventType.ScriptableEvent ? _event : _eventInstancer;

(153, 51)

private IScriptableEvent<T1, T2> Event => _eventType == EventType.ScriptableEvent ? _event : _eventInstancer;

(216, 55)

private IScriptableEvent<T1, T2, T3> Event => _eventType == EventType.ScriptableEvent ? _event : _eventInstancer;

Walter-Hulsebos avatar Apr 12 '23 08:04 Walter-Hulsebos

Unity Version: 2020.3.35f1 ExtEvents 1.7.0 GenericScriptableArchitecture 1.4.1 Generic Unity Objects 2.17.1 Solid Utilities 1.40.0 Type References 2.16.0 Unity Dropdown 1.2.0

Walter-Hulsebos avatar Apr 12 '23 08:04 Walter-Hulsebos

Could be fixed by doing things like so, tbh I'm not sure why it even is an error, but it is what it is.

private IScriptableEvent Event => _eventType == EventType.ScriptableEvent ? (IScriptableEvent) _event : (IScriptableEvent) _eventInstancer;

Walter-Hulsebos avatar Apr 12 '23 08:04 Walter-Hulsebos