mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
525 B
27 lines
525 B
using System.Collections.Generic; |
|
|
|
namespace ICSharpCode.Decompiler.Tests.TestCases.Ugly |
|
{ |
|
internal class NoNewOfT<TOnType> where TOnType : new() |
|
{ |
|
public static TOnType CreateTOnType() |
|
{ |
|
return new TOnType(); |
|
} |
|
|
|
public static T CreateUnconstrainedT<T>() where T : new() |
|
{ |
|
return new T(); |
|
} |
|
|
|
public static T CreateClassT<T>() where T : class, new() |
|
{ |
|
return new T(); |
|
} |
|
|
|
public static T CollectionInitializer<T>() where T : IList<int>, new() |
|
{ |
|
return new T() { 1, 2, 3, 4, 5 }; |
|
} |
|
} |
|
}
|
|
|