09/03/09 19:13:43
もしかしたら、.NET Frameworkのバグ(?)を見つけたかもしれないんですが、
本物か勘違いか、皆さんのご意見を伺いたいです。まずはサンプルコードを。
-----------------------
Type type = typeof(List<string>); // 型は何でもいいです
type.GetInterfaces(); // .NET Framework 1.1以降のメソッド
type.GetGenericArguments(); // 2.0以降のメソッド
Type delegator = new TypeDelegator(type);
delegator.GetInterfaces(); // 無問題
delegator.GetGenericArguments(); // NotSupportedExceptionをthrow
type.Equals((object)delegator); // false <= ???
type.Equals((Type)delegator); // true
delegator.Equals((object)type); // true
delegator.Equals((Type)type); // true
-----------------------
解説は次のレスで。