Skip to content

Instantly share code, notes, and snippets.

@tid-kijyun
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tid-kijyun/655a6ab6005f189e2711 to your computer and use it in GitHub Desktop.
Save tid-kijyun/655a6ab6005f189e2711 to your computer and use it in GitHub Desktop.
Genericクラスでデフォルト引数(enum)を持つメソッドの後に定義したメソッドはクラス内から見えなくなる ref: http://qiita.com/_tid_/items/77388352d30bb043315e
// Unityでエラーとなるコード(Ver4.6.3f1で確認 )
public enum EnumType {
Default,
TypeA,
}
public class Hoge<T> {
public void test() {
Found(); //!< OK
NotFound(); //!< error CS0103: The name 'NotFound' does not exist in the current context
}
public void Found() {
}
public void def(EnumType type = EnumType.Default) {
}
public void NotFound() {
}
}
public class Test {
public void test() {
var a = new Hoge<int>();
a.NotFound(); //!< 別クラスからならOK
}
}
@tid-kijyun
Copy link
Author

バグ報告済み

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment