1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Littlefoot: detect wrong number of arguments when compiling cast operation (#42)

This commit is contained in:
miketoon 2017-11-08 13:54:26 +00:00 committed by Julian Storer
parent ff1ba93a1b
commit 8589f38cfb

View file

@ -2062,6 +2062,9 @@ private:
void emitCast (CodeGenerator& cg, Type destType, int stackDepth) const
{
if (arguments.size() != 1)
location.throwError (getTypeName (destType) + " cast operation requires a single argument");
auto* arg = arguments.getReference (0);
const auto sourceType = arg->getType (cg);
arg->emit (cg, sourceType, stackDepth);