This project is read-only.
1

Resolved

Expression-bodied method + type parameter constraints

description

public class C {
    public bool IsNull<T>(T t) where T : class => t != null;
}
Compiler with errors (latest 'master'):
(5,48): error CS1003: Syntax error, ',' expected
(5,51): error CS1003: Syntax error, ',' expected
(5,53): error CS1003: Syntax error, ',' expected
(5,17): error CS0501: 'C.IsNull<T>(T)' must declare a body because it is not marked abstract, extern, or partial
(5,51): error CS0246: The type or namespace name 't' could not be found (are you missing a using directive or an assembly reference?)

comments

nmgafter wrote Oct 2, 2014 at 4:45 AM

This will be fixed in our next public rev of Roslyn.