Last active
August 29, 2015 14:18
-
-
Save tid-kijyun/655a6ab6005f189e2711 to your computer and use it in GitHub Desktop.
Genericクラスでデフォルト引数(enum)を持つメソッドの後に定義したメソッドはクラス内から見えなくなる ref: http://qiita.com/_tid_/items/77388352d30bb043315e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
バグ報告済み