Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
Fix InstUtil.findUnboundVariableUse for _
Browse files Browse the repository at this point in the history
- Fix findUnboundVariableUse so that it prints an error message if _ is
  used like a variable, instead of failing and confusing users who
  forget to fill in placeholders.
  • Loading branch information
perost authored and OpenModelica-Hudson committed Mar 13, 2017
1 parent d5b7bc2 commit 343d155
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Compiler/FrontEnd/InstUtil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -8053,6 +8053,12 @@ algorithm
case (exp as DAE.SIZE(),arg) then (exp,false,arg);
case (exp as DAE.CALL(path=Absyn.IDENT("isPresent"), attr = DAE.CALL_ATTR(builtin = true)),arg)
then (exp,false,arg);
case (DAE.CREF(componentRef = DAE.WILD()), (_, info))
algorithm
// _ shouldn't be allowed to be used like a variable, but until that's
// enforced just give an error message here instead of just failing.
Error.addSourceMessage(Error.WARNING_DEF_USE, {"_"}, info);
then (inExp, true, inTpl);
case (exp as DAE.CREF(componentRef=cr),(unbound,info))
equation
b = listMember(ComponentReference.crefFirstIdent(cr),unbound);
Expand Down

0 comments on commit 343d155

Please sign in to comment.