Jostarの開発メモ

プログラミング言語Jostar

class coins.sym.BaseTypeImpl cannot be cast to class coins.sym.VectorTypeというエラーコードが出る

2025-11-08 22:37:06
2025-11-08 23:08:38
目次

状況

 現在開発中のコミット(commit 242b057b332ff46593052cbca1ac824d108802a1 )にて、"hoge"など、文字列の定数を使うと、「Exception in thread "Thread-0" java.lang.ClassCastException: class coins.sym.BaseTypeImpl cannot be cast to class coins.sym.VectorType (coins.sym.BaseTypeImpl and coins.sym.VectorType are in unnamed module of loader 'app')」というエラーコードがコンソールに出力されます

対策

 文字列型( s型 )をsymRoot.typeU_Char型と解釈していますが、SYMのstringConst関数はsym.VectorType型を返すため、そのVectorTypeにそろえておく必要があります。つまり、文字列を配列と解釈するのです

予定

 次回のリリースで修正が反映されるかもしれません。

追記(2025年11月8日)

 このバグを修正しました(コミット[main 8af831b])。次回のリリースで反映されます

この記事を書いた人

dhrname