From 4c830cdbd5993883f671e17228afc39c3a21e5cc Mon Sep 17 00:00:00 2001 From: Li Jin Date: Mon, 13 Jan 2020 14:19:33 +0800 Subject: forbid exprlist appears in the left part of update statement. --- src/MoonP/moon_compiler.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/MoonP/moon_compiler.cpp b/src/MoonP/moon_compiler.cpp index e015939..0a5babe 100644 --- a/src/MoonP/moon_compiler.cpp +++ b/src/MoonP/moon_compiler.cpp @@ -1239,6 +1239,7 @@ private: auto action = assignment->action.get(); switch (action->getId()) { case "Update"_id: { + if (expList->exprs.size() > 1) throw std::logic_error(debugInfo("Can not apply update to multiple values."sv, expList)); auto update = static_cast(action); auto leftExp = static_cast(expList->exprs.objects().front()); auto leftValue = singleValueFrom(leftExp); -- cgit v1.2.3-55-g6feb