You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
errors are
(1) : RZ1017 Unexpected literal following the 'typeparam' directive. Expected 'line break'.
(As many as T is used) : CS0246 The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?)
T is set explicitly where the component is used.
.NET7, Visual Studio: 17.6.3, up-to-date as of 17th of June, 2023.
In a razor component, I can compile the following successfully, but the razor compiler generates superfluous errors:
@typeparam T where T : SomeBaseClass, new()
using a partial code-behind class doesn't work.
errors are
(1) : RZ1017 Unexpected literal following the 'typeparam' directive. Expected 'line break'.
(As many as T is used) : CS0246 The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?)
T is set explicitly where the component is used.
.NET7, Visual Studio: 17.6.3, up-to-date as of 17th of June, 2023.
added git repo for reproducing:
https://github.com/cetinbas/GenericTypeConstraintError
As a workaround, I deleted the constraints from razor file but kept them in the code-behind. This way it throws no errors.
The text was updated successfully, but these errors were encountered: