D言語 Part11
■ このスレッドは過去ログ倉庫に格納されています
0151デフォルトの名無しさん
2007/01/01(月) 20:18:09import f;
void main() {
func!(int)();
func!(char[])();
}
-----f.d-----
void hoge( int i ) {}
void func( T )()
{
hoge(cast(T)1);
}
-----エラーメッセージ-----
f.d(11): Error: cannot cast int to char[]
f.d(11): function f.hoge (int) does not match parameter types (char[])
f.d(11): Error: cannot cast int to char[]
f.d(11): Error: cannot implicitly convert expression (cast(char[])1) of type cha
r[] to int
f.d(11): Error: cannot cast int to char[]
f.d(5): template instance f.func!(char[]) error instantiating // ちょちょww
バグじゃね?
■ このスレッドは過去ログ倉庫に格納されています