От: | _NN_ | www.nemerleweb.com | |
Дата: | 13.03.19 13:27 | ||
Оценка: |
using System;
public class A
{
static void NotNull<T>(T obj)
where T : class
{
}
static void NotNull<T>(T? obj)
where T : struct
{
}
static void F<T>(T t) { NotNull(t); }
public static void Main()
{
}
}
Compilation error (line 16, col 26): The type 'T' must be a reference type in order to use it as parameter 'T' in the generic type or method 'A.NotNull<T>(T)