struct mystruct{} void main() { mystruct* a= new mystruct; mystruct b= cast(mystruct)a; } teststructnew.d(5): Error: no property 'opCall' for type 'mystruct' teststructnew.d(5): Error: function expected before (), not 1 of type int teststructnew.d(5): Error: no property 'opCall' for type 'mystruct' teststructnew.d(5): Error: function expected before (), not 1 of type int teststructnew.d(5): Error: cannot implicitly convert expression (1(1(a))) of type int to mystruct I think message: cannot implicitly convert from type mystruct* to mystruct would be more clear.
it's not implicitly , just the cast should be banned.
Even it's banned, the compiler should give better message to the user.
Fixed dmd 1.028 and 2.012
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル