Changeset 13931


Ignore:
Timestamp:
Nov 1, 2019 12:37:10 PM (2 weeks ago)
Author:
molsson
Message:

#5843 Updated error message NON_FIXED_CONDITIONAL_GUARD and added a test.

Location:
branches/dev-mo-2617/Compiler/ModelicaFrontEnd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-mo-2617/Compiler/ModelicaFrontEnd/src/jastadd/errorcheck/TypeCheck.jrag

    r13913 r13931  
    195195    public static final SimpleProblemProducer ASTNode.NON_FIXED_CONDITIONAL_GUARD =
    196196            new SimpleErrorProducer("NON_FIXED_CONDITIONAL_GUARD", ProblemKind.SEMANTIC,
    197                     "The guard expression of a conditional component should have parameter or constant variability");
     197                    "The guard expression of a conditional component must be a fixed parameter expression");
    198198
    199199    @Override
  • branches/dev-mo-2617/Compiler/ModelicaFrontEnd/test/modelica/NameTests.mo

    r13913 r13931  
    34363436
    34373437
     3438model ConditionalComponentTest18_Err
     3439    parameter Boolean b(start = false, fixed = false);
     3440    Real x if b;
     3441    Real y if time > 5;
     3442annotation(__JModelica(UnitTesting(tests={
     3443    ErrorTestCase(
     3444        description="Checking that conditional guard is a fixed parameter expression.",
     3445        errorMessage="
     3446Error at line 3, column 5, in file '...', NON_FIXED_CONDITIONAL_GUARD:
     3447  The guard expression of a conditional component must be a fixed parameter expression
     3448Error at line 4, column 5, in file '...', NON_FIXED_CONDITIONAL_GUARD:
     3449  The guard expression of a conditional component must be a fixed parameter expression
     3450
     3451")})));
     3452end ConditionalComponentTest18_Err;
     3453
     3454
    34383455
    34393456model AttributeDot1
Note: See TracChangeset for help on using the changeset viewer.