mirror of
https://github.com/aNNiMON/Own-Programming-Language-Tutorial.git
synced 2024-09-20 08:44:20 +03:00
Улучшен вывод ошибки при несовпадении типов
This commit is contained in:
parent
3b90e544a7
commit
eb2ab6ee50
@ -17,6 +17,6 @@ public final class Types {
|
||||
if (FIRST <= type && type <= LAST) {
|
||||
return NAMES[type];
|
||||
}
|
||||
return "unknown";
|
||||
return "unknown (" + type + ")";
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public final class ContainerAccessExpression implements Expression, Accessible {
|
||||
return ((MapValue) container).get(lastIndex);
|
||||
|
||||
default:
|
||||
throw new TypeException("Array or map expected. Got " + container.type());
|
||||
throw new TypeException("Array or map expected. Got " + Types.typeToString(container.type()));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user