-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The type parameter 'TQueryType' cannot be used with the 'as' operator because it does not have a class type constraint nor a 'class' constraint #2396
Comments
The IL code is weird here.
The So I don't think we can easily fix this :( |
I can reproduce the weird IL sequence with:
I think we would first need to implement support for pattern matching, as it's only in the context of the whole pattern that we could detect that the second |
Actually we had this topic before for non-generic types: #1903 Not sure why the workaround doesn't trigger for generic types, but that might be easy to fix. |
Oh nice, thanks for the info and fix. I'll try the next few days again! |
…strained generic types. The logic in the `FixLoneIsInst` transform already handled this correctly, it's just the check in the `isinst` translation that handled the `IsReferenceType == null` case incorrectly.
Input code
Please see #2389
Relevant section in official CSReference
https://github.com/Unity-Technologies/UnityCsReference/blob/61f92bd79ae862c4465d35270f9d1d57befd1761/Modules/Subsystems/SubsystemManager.cs#L35
Erroneous output
<UnityEngine>\UnityEngine\SubsystemManager.cs:3536 The type parameter 'TQueryType' cannot be used with the 'as' operator because it does not have a class type constraint nor a 'class' constraint
Same issue for
AddDescriptorSubset
https://github.com/Unity-Technologies/UnityCsReference/blob/61f92bd79ae862c4465d35270f9d1d57befd1761/Modules/Subsystems/SubsystemDescriptorStore.cs#L29Details
Please see #2389
The text was updated successfully, but these errors were encountered: