Modelica 3.x (.mo)
@modelscript/modelica (languages/modelica) is the flagship physical modeling language of ModelScript. It provides a complete Modelica 3.x compiler pipeline—from a native WebAssembly GLR parser and Salsa query engine to an AssemblyScript/TypeScript arena flattener (ModelicaFlattener) and the full Modelica Standard Library (MSL 4.0.0).
Compilation Pipeline
Core Language Coverage
- Class Specializations:
model,block,connector,expandable connector,record,type,package,function,operator,operator record,operator function - Inheritance & Redeclarations: Multiple
extends,redeclare,replaceable,constrainedby,inner/outerdynamic scoping, and deep hierarchical class modifications - Equations & Algorithms: Differential equations (
der(x)),connect(a, b)(both potential/flow andstreamconnectors),if/for/whenequations,initial equation, and imperativealgorithm/initial algorithmsections - Synchronous Clocks (Modelica 3.3+):
Clock,sample,hold,previous,subSample,superSample,shiftSample,backSample
Polyglot & Physical Extensions (languages/modelica/src/extensions/)
Beyond standard Modelica 3.x, @modelscript/modelica includes first-class compiler extensions for 3D CAD geometry, multiphysics FEA/CFD studies, formal verification, and localization:
- Embedded 3D CSG & STEP Export (
shape-flattener.ts,csg.ts,cad.ts):ShapeFlattenerextractsModelica.Mechanics.MultiBody.Visualizers.FixedShapecomponents, parametric dimensions, andPlacementtransformations directly from flattened models.- Compiles visualizers into parametric OpenSCAD scripts (
npx msx csg ModelName file.mo) or exports watertight ISO 10303-21 STEP B-Rep geometry via themodelscript/exportShapeToStepLSP command.
- Embedded FEA & CFD Multiphysics Studies (
study-flattener.ts,studies.ts):StudyFlattener(modelscript/flattenStudy) extracts embedded structural and fluid study annotations, material properties, and boundary conditions from Modelica components to synthesize CalculiX (.inp) and SU2 (.cfg) solver decks.
- Octagon Abstract Interpretation & Formal Safety Verification (
src/formal/):ModelicaCfgLowerer(modelica-cfg-lowerer.ts),ModelicaAbstractEvaluator(modelica-abstract-evaluator.ts), andModelicaStaticAnalyzer(modelica-analyzer.ts) lower flattened DAE equations andalgorithmstatements into relational Control Flow Graphs evaluated over the Octagon Abstract Domain (). PhysicalInvariantBridge(physical-invariant-bridge.ts) proves division-by-zero freedom, square-root/logarithm domain safety, and physical state invariants (domain.octagon()).
- Gettext
.po/.potInternationalization (po.ts):- Extracts translatable description strings and
Dialog/Documentationannotations into GNU Gettext.pottemplates and merges localized.pocatalogs (npx msx i18n).
- Extracts translatable description strings and
Semantic Linter (languages/modelica/src/lints/)
ModelScript enforces 307 OpenModelica-compatible diagnostic rules across six modular analyzers:
| Module | Representative Checks |
|---|---|
syntax-placement.ts | M1001–M1003: Parse errors, missing tokens, empty array constructors |
queries.ts | M2001–M2005: Duplicate elements, unresolved variables/classes/modifiers, identifier mismatches |
types-expressions.ts | M3001–M3006: Binding/modifier/argument type mismatches, array dimension checks |
hierarchy-variability.ts | M4001–M4005: Circular extends, duplicate modifications, protected access violations, variability ordering |
connections-streams.ts | M3003–M3004: Connector plug-compatibility, stream connector rules, cardinality checks |
synchronous-clocks.ts & cfa.ts | Clock partitioning rules, uninitialized discrete variables, structural singularity diagnostics |
307 rules281 error12 info2 notification12 warning Run with msx lint
| Code | Rule | Severity | Message |
|---|---|---|---|
M1000 | identity-arg-count | error | Wrong number of arguments to identity. |
M1001 | parse-error | error | Parse error. |
M1002 | parse-missing | error | Parse error: '<expected>' expected. |
M1003 | empty-array-constructor | error | Parse error: Empty array constructors are not valid in Modelica. |
M1003 | emptyarrayconstructor | error | Empty array constructor '<target>' is not valid in Modelica. |
M1004 | identity-first-arg-integer | error | First argument to identity in component <compName> must be Integer expression. |
M1005 | subscripted-modifier | error | Subscripting modifiers is not allowed. Apply the modification on the whole identifier using an array-expression or an each-modifier. |
M1099 | wasm-flattener-unsupported | error | [ModelicaFlattener] Model '<rootName>' could not be flattened using strict WASM backend. |
M2001 | duplicate-element | error | An element with name <name> is already declared in this scope. |
M2002 | variable-not-found | error | Variable <name> not found in scope <scope>. |
M2002 | variablenotfound | error | Variable <vName> not found in scope <className>. |
M2003 | class-not-found | error | Class <className> not found in scope <scope> (looking for a function or record). |
M2003 | typenotfound | error | Class or type '<fullType>' not found in scope. |
M2004 | modifier-not-found | error | In modifier of '<componentName>', class or component '<modName>' not found in '<className>'. |
M2005 | identifier-mismatch | error | The identifier at start and end are different. |
M2005 | identifiermismatch | error | Parse error: The identifier at start and end are different |
M2006 | modified-element-not-found | error | Modified element <modName> not found in class <className>. |
M2007 | modifier-class-not-found | error | In modifier (<modText>), class or component <modName> not found in <<className>>. |
M2011 | same-name-type-shadowing | error | Found a component with same name when looking for type <typeSpec>. |
M2012 | class-not-found-in-scope | error | Class <className> not found in scope <scope>. |
M2013 | base-class-not-found-in-scope | error | Base class <className> not found in scope <scope>. |
M2014 | partial-base-class | error | Part <partName> of base class name <extName> is not a class. |
M2015 | base-class-ambiguous | error | The base class name <partName> was found in one or more base classes: <candidateNames>. |
M2016 | base-class-found-in | error | <partName> was found in base class <baseName>. |
M2038 | partial-lookup-disallowed | error | <className> is partial, name lookup is not allowed in partial classes. |
M2090 | finaloverridenotification | info | From here: |
M2090 | from-here | notification | From here: |
M2091 | redeclare-final-component-notification | info | From here: |
M2091 | redeclarefinalcomponentnotification | info | From here: |
M2092 | redeclare-constant-component-notification | info | From here: |
M2092 | redeclareconstantcomponentnotification | info | From here: |
M2093 | duplicate-modification-notification | info | From here: |
M2093 | duplicatemodificationnotification | info | From here: |
M2094 | missing-inner | warning | No corresponding 'inner' declaration found for component .<typeName> <componentName> declared as 'outer'. The existing 'inner' components are: <inners> Check if you have not misspelled the 'outer' component name. Please declare an 'inner' component with the same name in the top scope. Continuing flattening by only considering the 'outer' component declaration. |
M2094 | missinginner | warning | No corresponding 'inner' declaration found in scope for outer component '<target>'. |
M2095 | from-here-trace | notification | From here: |
M2096 | redeclare-non-replaceable-notification | info | From here: |
M2096 | redeclarenonreplaceablenotification | info | From here: |
M2097 | protected-modification-notification | info | From here: |
M2097 | protectedmodificationnotification | info | From here: |
M3001 | type-mismatch-binding | error | Type mismatch in binding <componentName> = <actualExpr>, expected subtype of <expectedType>, got type <actualType>. |
M3001 | typemismatchbinding | error | Type mismatch in binding <target>, expected subtype of <expName>, got type <actName>. |
M3002 | type-mismatch-modifier | error | Type mismatch: '<modName>' expects type '<expectedType>' but got '<actualType>'. |
M3002 | typemismatchmodification | error | Type mismatch in binding or modification expression '<target>'. |
M3003 | not-plug-compatible | error | The connectors in connect(<ref1>, <ref2>) are not type compatible. |
M3004 | not-a-connector | error | <which> is not a valid connector. |
M3005 | redeclare-type-mismatch | error | Redeclare of '<redeclaredName>': type '<newType>' is not compatible with constraining type '<constrainingType>'. |
M3006 | function-arg-type-mismatch | error | Type mismatch for positional argument <argPosition> in <callExpr>. The argument has type: <argTypeSignature> expected type: <expectedTypeSignature> |
M3007 | connect-invalid-form | error | <ref> is not a valid form for a connector, connectors must be either c1.c2...cn or m.c (where c is a connector and m is a non-connector). |
M3008 | extends-type-mismatch | error | In extends of '<className>': redeclared '<redeclaredName>' of type '<newType>' is not compatible with original type '<originalType>'. |
M3009 | array-index-type-mismatch | error | Array index type mismatch: expected Integer or Boolean, but got '<actualType>'. |
M3009 | arrayindextypemismatch | error | Array index '<target>' has invalid type: expected Integer or Boolean. |
M3010 | unit-mismatch | warning | Unit mismatch: Left-hand side has unit '<lhsUnit>' but right-hand side has incompatible unit '<rhsUnit>'. |
M3010 | unitmismatchbinding | warning | Unit mismatch in equation '<target>'. |
M3010 | unitmismatchequation | warning | Unit mismatch in equation '<target>'. |
M3011 | binary-op-type-mismatch | error | Cannot resolve type of expression <expr>. The operands have types <type1>, <type2> in component <NO_COMPONENT>. |
M3012 | optimization-objective-type | error | Optimization objective must be a scalar Real, but got type '<typeStr>'. |
M3013 | optimization-constraint-type | error | Optimization constraints must evaluate to scalar Real or Boolean expressions, but got type '<typeStr>'. |
M3014 | builtin-attribute-type-mismatch | error | Type mismatch in binding <attrName> = <bindingText>, expected subtype of <expectedType>, got type <actualType>. |
M3015 | attribute-type-mismatch | error | Variable <varName>: Wrong type on builtin attribute <attrName> (type was: <actualType>, expected: <expectedType>). |
M3016 | conditional-type-mismatch | error | Type error in conditional '<condExpr>'. Expected Boolean, got <actualType>. |
M3017 | connect-types-inconsistent | error | The type of variables <r0Raw> type: <type0> and <r1Raw> type: <type1> are inconsistent in connect equations. |
M3018 | array-element-type-mismatch | error | Array constructor elements have inconsistent types in '<exprText>'. |
M3018 | arrayelementtypemismatch | error | Array element type mismatch in '<target>'. |
M3019 | no-matching-function | error | No matching function found for <callExpr> of type <callSig> candidates are <candidateSig> |
M3020 | type-mismatch-modifier-binding | error | Type mismatch in modifier of component <compName>, expected type <expectedType>, got modifier <exprText> of type <actualType>. |
M3021 | function-return-type-mismatch | error | Function '<funcName>' returns type '<actualType>' but '<expectedType>' expected. |
M4000 | dimension-not-parameter | error | Expression '<exprName>' that determines the size of dimension '<dim>' of '<callText>' is not an evaluable parameter expression. |
M4001 | extends-cycle | error | extends <baseName> causes an instantiation loop. |
M4001 | extendscycle | error | Extends cycle detected for '<target>'. |
M4002 | duplicate-modification | error | Duplicate modification of element <elementName> on <kind> <componentName>. |
M4002 | duplicatemodification | error | <outerName>.<innerOrKind> |
M4003 | array-dimension-mismatch | error | Type mismatch in binding '<componentName> = <exprText>', expected array dimensions [<expectedShape>], got [<actualShape>]. |
M4003 | arrayshapemismatch | error | Array shape mismatch: declared dimension does not match initializer element count in '<target>'. |
M4004 | unbalanced-model | warning | The <classKind> '<name>' is not balanced: <nEquations> equation(s) and <nVariables> variable(s). |
M4004 | unbalancedmodel | warning | Model '<target>' is not balanced: <value> equations for <value> variables. |
M4005 | protected-modification | error | Protected element '<elementName>' may not be modified, got '<modText>'. |
M4005 | protectedmodification | error | Protected element '<eName>' may not be modified, got '<mText>'. |
M4006 | external-with-algorithm | error | Element is not allowed in function context: algorithm |
M4006 | externalwithalgorithm | error | Element '<target>' is not allowed in function context with algorithm section. |
M4007 | function-public-variable | error | Invalid public variable <varName>, function variables that are not input/output must be protected. |
M4007 | functionpublicvariable | error | Invalid public variable <varName>, function variables that are not input/output must be protected. |
M4008 | array-subscript-count-mismatch | error | Wrong number of subscripts in <refStr> (<actualCount> subscripts for <expectedCount> dimensions). |
M4009 | function-default-arg-cycle | error | The default value of <paramName> causes a cyclic dependency. |
M4010 | function-invalid-var-type | error | Invalid type <typeName> for function component <varName>. |
M4011 | function-protected-io | error | Invalid protected variable <varName>, function variables that are input/output must be public. |
M4011 | functionprotectedio | error | Invalid protected variable <varName>, function variables that are input/output must be public. |
M4012 | function-arg-variability | error | Function argument <paramName>=<argExpr> in call to <funcName> has variability <actualVariability> which is not a <requiredVariability> expression. |
M4013 | nested-when-statement | error | Nested when statements are not allowed. |
M4013 | nestedwhen | error | Nested when statements are not allowed. |
M4014 | tuple-expression-context | error | Tuple expressions may only occur on the left side of an assignment or equation with a single function call on the right side. Got the following expression: <exprText>. |
M4014 | tupleexpressioncontext | error | Tuple expressions may only occur on the left side of an assignment or equation with a single function call on the right side. |
M4015 | within-in-script | error | The within directive is not allowed in script mode. |
M4016 | statement-in-standard-mode | error | Top-level statements are not allowed in standard Modelica mode. |
M4017 | restriction-violation | error | <what> are not allowed in <classKind>. |
M4017 | restrictionviolation | error | Algorithm sections are not allowed in <kindStr>. |
M4018 | partial-instantiation | error | Illegal to instantiate partial class <className>. |
M4019 | redeclare-non-replaceable | error | Redeclaration with a new type requires '<elementName>' to be replaceable. |
M4019 | redeclarenonreplaceable | error | Redeclaration with a new type requires '<eName>' to be replaceable. |
M4020 | builtin-time-invalid | error | time is not allowed in a function. |
M4020 | reservedbuiltintime | error | Identifier time is reserved for the built-in element with the same name. |
M4020 | timeinfunction | error | time is not allowed in a function. |
M4021 | range-step-too-small | error | Step size <stepSize> in range is too small. |
M4022 | enum-range-with-step | error | Range of type enumeration <enumType> may not specify a step size. |
M4022 | enumrangewithstep | error | Range of type enumeration '<target>' may not specify a step size. |
M4023 | connect-in-when | error | connect may not be used inside when-equations (found <connectExpr>). |
M4023 | connectinwhen | error | connect may not be used inside when-equations (found <target>). |
M4024 | connect-in-initial | error | Connect equations are not allowed in initial equation sections. |
M4024 | connectininitial | error | Connect equations are not allowed in initial equation sections. |
M4025 | connect-in-non-param-if | error | connect may not be used inside if-equations with non-parametric conditions (found <connectExpr>). |
M4025 | connectinnonparamif | error | connect may not be used inside if-equations with non-parametric conditions (found <target>). |
M4026 | final-override | error | Trying to override final element <elementName> with modifier '<modText>'. |
M4026 | finaloverride | error | Trying to override final element <eName> with modifier '<mText>'. |
M4027 | variability-binding-mismatch | error | Component <componentName> of variability <compVariability> has binding '<bindingExpr>' of higher variability <bindingVariability>. |
M4027 | variabilitybindingmismatch | error | Component <compName> of variability parameter has binding '<target>' of higher variability continuous. |
M4028 | partial-type-component | error | Component '<componentName>' has partial type '<typeName>'. |
M4028 | partialtypecomponent | error | Component '<target>' has partial type. |
M4029 | component-binding-restriction | error | Component '<componentName>' may not have a binding equation due to class specialization '<classKind>'. |
M4030 | outer-modifier | error | Modifier '<modText>' found on outer element <elementName>. |
M4030 | outermodifier | error | Modifier '<modNode>' found on outer element <nameNode>. |
M4031 | array-index-out-of-bounds | error | Subscript '<index>' for dimension <dimensionIndex> (size = <dimensionSize>) of <arrayName> is out of bounds. |
M4031 | arrayindexoutofbounds | error | Subscript 'index' for dimension <dimIndex> (size = <dimSize>) of array is out of bounds. |
M4032 | function-invalid-prefix | error | Invalid prefix <prefix> on formal parameter <varName>. |
M4032 | functioninvalidprefix | error | Invalid prefix '<target>' on formal parameter in function. |
M4033 | function-multiple-algorithm | error | Function <funcName> has more than one algorithm section or external declaration. |
M4033 | functionmultiplealgorithm | error | Function <name> has more than one algorithm section or external declaration. |
M4034 | replaceable-base-class | error | Class '<className>' in 'extends <extendsText>' is replaceable, the base class name must be transitively non-replaceable. |
M4034 | replaceablebaseclass | error | Class '<target>' in 'extends <target>' is replaceable, the base class name must be transitively non-replaceable. |
M4035 | cyclic-dimension-dependency | error | Dimension <dimNum> of <varName>, '<exprText>', could not be evaluated due to a cyclic dependency. |
M4036 | package-variable-not-constant | error | Variable <varName> in package <packageName> is not constant. |
M4037 | connector-variability | error | Invalid variability <variability> on connector '<connectorName>'. |
M4037 | connectorvariability | error | Invalid variability <pfx> on connector '<compName>'. |
M4038 | flow-outside-connector | warning | Prefix 'flow' used outside connector declaration. |
M4038 | flowoutsideconnector | warning | Prefix '<target>' used outside connector declaration. |
M4039 | discrete-not-on-lhs | error | Following variable is discrete, but does not appear on the LHS of a when-statement: '<varName>'. |
M4039 | discretenotonlhs | error | Following variable is discrete, but does not appear on the LHS of a when-statement: '<target>'. |
M4040 | protected-element-modification | error | Protected element '<varName>' may not be modified, got '<modText>'. |
M4041 | negative-dimension | error | Negative dimension index (<dim>) for component <varName>. |
M4041 | negativedimension | error | Negative dimension index (-1) for component component. |
M4042 | constant-has-no-value | error | Constant '<qualifiedName>' has no value. |
M4042 | constanthasnovalue | error | Constant '<target>' has no value. |
M4043 | constant-variability-violation | error | Component <componentName> of variability constant has binding '<bindingText>' of higher variability <bindingVariability>. |
M4043 | constantvariabilityviolation | error | Component <compName> of variability constant has binding '<target>' of higher variability <varbNode>. |
M4044 | non-array-modification | error | Non-array modification '<modText>' for array component '<componentName>', possibly due to missing 'each'. |
M4044 | nonarraymodification | error | Non-array modification '<fullMod>' for array component, possibly due to missing 'each'. |
M4045 | modified-element-not-found-cst | error | Modified element <modName> not found in class <className>. |
M4045 | modifiedelementnotfound | error | Modified element <eText> not found in class <tText>. |
M4046 | constant-not-fixed | error | Constant '<componentName>' must be fixed but has 'fixed = false' |
M4046 | constantnotfixed | error | Constant declaration '<target>' must be fixed. |
M4047 | cardinality-invalid-context | error | cardinality may only be used in the condition of an if-statement/equation or an assert. |
M4047 | cardinalityinvalidcontext | error | Operator '<target>' may only be used in the condition of an if-statement/equation or an assert. |
M4048 | cardinality-expected-component | error | Expected <name> to be a component, but found class instead. |
M4048 | cardinalityexpectedcomponent | error | Expected <target> to be a component, but found class instead. |
M4049 | break-on-non-component | error | Invalid use of break on non-component '<name>'. |
M4049 | breakonnoncomponent | error | Invalid use of break on non-component '<ident>'. |
M4050 | break-component-invalid-type | error | Invalid use of break on component '<name>', component must be a model, block, or connector. |
M4050 | breakcomponentinvalidtype | error | Invalid use of break on component '<ident>', component must be a model, block, or connector. |
M4051 | break-connect-not-found | error | No matching element found for '<connText>'. |
M4051 | breakconnectnotfound | error | No matching element found for '<target>'. |
M4052 | redeclare-final-component | error | Redeclaration of final component <name> is not allowed. |
M4052 | redeclarefinalcomponent | error | Redeclaration of final component <eName> is not allowed. |
M4053 | redeclare-constant-component | error | Redeclaration of constant component <name> is not allowed. |
M4053 | redeclareconstantcomponent | error | Redeclaration of constant component <eName> is not allowed. |
M4054 | stream-unbalanced-connector | error | Invalid stream connector <connectorName>: A stream connector must have exactly one flow variable, this connector has <flowCount> flow variables. |
M4054 | streamunbalancedconnector | error | Invalid stream connector .<cName>: A stream connector must have exactly one flow variable, this connector has <fCount> flow variables. |
M4055 | cannot-connect-expandable-with-non-expandable | error | Cannot connect expandable connector <expName> with non-expandable connector <nonExpName>. |
M4055 | cannotconnectexpandablewithnonexpandable | error | Cannot connect expandable connector <expRef> with non-expandable connector <nonExpRef>. |
M4056 | duplicate-inherited-element-not-identical | error | Duplicate elements (due to inherited elements) not identical: first element is: <currText> second element is: <prevText> |
M4057 | expandable-connector-flow-element | error | Prefix 'flow' on component '<compName>' not allowed in class specialization 'expandable connector'. |
M4057 | expandableconnectorflowelement | error | Prefix 'flow' on component '<compName>' not allowed in class specialization 'expandable connector'. |
M4058 | recursive-definition | error | Declaration of element <elemName> causes recursive definition of class <className>. |
M4059 | max-recursion-depth-exceeded | error | The maximum recursion depth of <depth> was reached, probably due to mutually recursive definitions. |
M4061 | redeclare-non-inherited | error | Illegal redeclare of element <elementName>, no inherited element with that name exists. |
M4061 | redeclarenoninherited | error | Illegal redeclare of element <eName>, no inherited element with that name exists. |
M4062 | invalid-external-object | error | External object <className> contains invalid element '<elemName>'. |
M4063 | class-extends-non-inherited | error | Base class targeted by class extends <className> not found in the inherited classes. |
M4063 | classextendsnoninherited | error | Invalid redeclaration of class <eName>, class extends only allowed on inherited classes. |
M4064 | protected-in-connector | error | Protected sections are not allowed in connector. |
M4064 | protectedinconnector | error | Protected sections are not allowed in <kindStr>. |
M4065 | equationinconnector | error | Equations are not allowed in connector. |
M4065 | equations-in-connector | error | Equations are not allowed in connector. |
M4066 | algorithm-in-connector | error | Algorithm sections are not allowed in connector. |
M4066 | algorithminconnector | error | Algorithm sections are not allowed in connector. |
M4067 | external-object-missing-constructor | error | External object <className> is missing a constructor. |
M4068 | redeclare-condition-attribute | error | Invalid redeclaration of <elementName>, a redeclare may not have a condition attribute. |
M4068 | redeclareconditionattribute | error | Invalid redeclaration of <eName>, a redeclare may not have a condition attribute. |
M4069 | external-object-return-restriction | error | Function <fnName> returns an external object, but the only function allowed to return this object is <extObjName>.constructor. |
M4070 | external-non-function | error | Class specialization violation: <className> is a <specialization>, which may not contain an external declaration. |
M4070 | externalnonfunction | error | Class specialization violation: <name> is a <kindStr>, which may not contain an external declaration. |
M4071 | external-invalid-language | error | '<lang>' is not a valid language for an external function. |
M4072 | external-invalid-arg-expr | error | Expression <expr> cannot be an external argument. Only identifiers, scalar constants, and size-expressions are allowed. |
M4073 | external-invalid-arg-size-const | error | Invalid external argument '<expr>', the dimension index must be a constant expression. |
M4074 | external-array-return-not-allowed | error | The lhs (result) of the external function declaration has array type (<typeStr>), but this is not allowed in the specification. You need to pass it as an input to the function (preferably also with a size()-expression to avoid out-of-bounds errors in the external call). |
M4075 | invalid-type-prefix-flow-nested | error | Invalid type prefix 'flow' on variable <varName>, due to existing type prefix 'flow'. |
M4076 | parameter-bound-contradiction | error | Contradictory bounds for parameter '<paramName>': lower bound '<lower>' exceeds upper bound '<upper>'. |
M4076 | parameterboundcontradiction | error | Contradictory bounds for parameter 'parameter': lower bound 'min' exceeds upper bound 'max'. |
M4077 | loop-termination-inconclusive | error | Loop over '<loopVar>' with condition '<condition>' cannot be proven to terminate. |
M4078 | terminate-in-function | error | terminate is not allowed in a function. |
M4078 | terminateinfunction | error | terminate is not allowed in a function. |
M4079 | return-outside-function | error | 'return' may not be used outside function. |
M4079 | returnoutsidefunction | error | 'return' may not be used outside function. |
M4080 | cyclic-constants-or-parameters | error | Cyclically dependent constants or parameters found in scope <scopeName>: {<cycleList>} (ignore with -d=ignoreCycles). |
M4081 | cyclic-function-components | error | Cyclically dependent function components found: {<cycleList>} |
M4082 | connector-non-parameter-subscript | error | Connector '<connRef>' has non-parameter subscript '<subscriptText>'. |
M4083 | enum-duplicate-literal | error | Enumeration has duplicate names: <dup> in list of names <list>. |
M4084 | enum-reserved-attribute-literal | error | Invalid use of reserved attribute name <name> as enumeration literal. |
M4091 | break-outside-loop | error | 'break' must be inside a for or while loop, or enclose a connect equation. |
M4091 | breakoutsideloop | error | 'break' may only be used in a while- or for-loop. |
M4092 | binding-dimension-mismatch | error | Type mismatch in binding '<componentName> = <bindingText>', expected array dimensions [<expectedDims>], got [<actualDims>]. |
M4093 | unused-input-variable | warning | Unused input variable <varName> in function <funcName>. |
M4094 | cardinality-in-condition-only | error | cardinality may only be used in the condition of an if-statement or if-equation. |
M4095 | conditional-expression-not-evaluated | error | The conditional expression <condText> could not be evaluated. |
M4096 | dimensions-must-be-parameter | error | Dimensions must be parameter or constant expression (in <callStr>). |
M4097 | called-function-partial | error | Called function '<fnName>' is partial. |
M4098 | class-specialization-violation | error | Class specialization violation: <className> <errorDetail>. |
M4099 | cannot-connect-undeclared-expandable-connectors | error | Cannot connect undeclared connectors <c1> with <c2>. At least one of them must be declared. |
M4101 | top-level-outer-element | error | The model can't be instantiated due to top-level outer element '<elementName>', it may only be used as part of a simulation model. |
M4102 | inner-not-found-existing-decl | error | An inner declaration for outer element '<elementName>' could not be found, and could not be automatically generated due to an existing declaration of that name. |
M4103 | missing-redeclare-keyword | error | Missing redeclare keyword on attempted redeclaration of class <className>. |
M4104 | invalid-redeclaration-class-as-component | error | Invalid redeclaration of class <className> as component. |
M4105 | duplicate-redeclare | error | <name> is already redeclared in this scope. |
M4106 | invalid-redeclaration-prefix | error | Invalid redeclaration '<newPrefix> <name>', original element is declared '<origPrefix>'. |
M4107 | invalid-redeclaration-component-as-class | error | Invalid redeclaration of component <compName> as class. |
M4108 | redeclare-enum-not-subtype-generic | error | Redeclaration of enumeration '<name>' is not a subtype of the redeclared element (use enumeration(:) for a generic replaceable enumeration). |
M4109 | redeclare-enum-not-subtype | error | Redeclaration of enumeration '<name>' is not a subtype of the redeclared element. |
M4110 | invalid-type-prefix-conflict | error | Invalid type prefix '<newPrefix>' on component <compName>, due to existing type prefix '<existingPrefix>'. |
M4111 | invalid-redeclaration-basic-type-attribute | error | Invalid redeclaration of <attrName>, attributes of basic types may not be redeclared. |
M4112 | extends-other-base-class | error | Found other base class for extends <baseName> after instantiating extends. |
M4113 | external-object-missing-destructor | error | External object <className> is missing a destructor. |
M4114 | invalid-connector-variability | error | Invalid variability <variability> on connector '<compName>'. |
M4115 | external-object-not-replaceable | error | '<elemName>' may not be replaceable. |
M4116 | operator-encapsulation | error | Operator <recordName>.'<opName>' is not encapsulated. |
M4117 | operator-constructor-outputs | error | Operator <recordName>.'constructor' must have exactly one output. |
M4118 | operator-constructor-output-type | error | Output '<outputName>' in operator <recordName>.'constructor' must be of type <recordName>, got type <actualType>. |
M4119 | variable-in-package-not-constant | error | Variable <varName> in package <pkgName> is not constant. |
M4120 | ambiguous-operator-overload | error | Ambiguous matching overloaded operator functions found for <exprText>. Candidates are: <candidatesText> |
M4121 | no-matching-operator-function | error | No matching function found for <callExprText>. Candidates are: <candidatesText> |
M4122 | cannot-resolve-operator-type | error | Cannot resolve type of expression <exprText>. The operands have types <leftType>, <rightType> in component <NO_COMPONENT>. |
M5001 | equation-type-mismatch | error | Type mismatch in equation <lhsExpanded>=<rhsExpanded> of type <lhsType>=<rhsType>. |
M5001 | equationtypemismatch | error | Type mismatch in equation <eqText2> of type <lName>=<rName>. |
M5002 | constrainedby-type-mismatch | error | Replaceable '<componentName>': default type '<defaultType>' is not compatible with constraining type '<constrainingType>'. |
M5003 | if-branch-type-mismatch | error | If-equation branch type mismatch: '<varName>' assigned type '<branchType>' but expected '<expectedType>'. |
M5004 | connect-flow-mismatch | error | Cannot connect flow component <flowComp> to non-flow component <nonFlowComp>. |
M5004 | connectflowmismatch | error | Cannot connect flow component <flowRef>.<elemIdent> to non-flow component <nonFlowRef>.<elemIdent>. |
M5005 | division-by-zero | error | Division by zero: <lhs> / 0. |
M5005 | divisionbyzero | error | Division by literal zero in '<target>'. |
M5006 | assignment-type-mismatch | error | Type mismatch in assignment in <target> := <source> of <targetType> := <sourceType> |
M5006 | assignmenttypemismatch | error | Type mismatch in assignment in <target> of <tName> := <vName> |
M5007 | for-iterator-not-1d | error | Iterator <iteratorName>, has type <shape>, but expected a 1D array expression. |
M5007 | foriteratornot1d | error | Iterator iterator, has type Real, but expected a 1D array expression. |
M5008 | assignment-to-constant | error | Trying to assign to constant component in <componentName> := <exprText> |
M5008 | assignmenttoconstant | error | Trying to assign to constant component <idNode>. |
M5009 | assignment-to-input | error | Trying to assign to input component '<componentName>'. |
M5009 | assignmenttoinput | error | Trying to assign to input component <idNode>. |
M5010 | homotopy-recommended | info | Equation contains steep nonlinearity '<term>' without homotopy. Consider wrapping with homotopy(actual, simplified). |
M5011 | assignment-to-parameter | error | Trying to assign to parameter component in <componentName> := <exprText> |
M5012 | assignment-to-iterator | error | Assignment to iterator '<iteratorName>'. |
M5013 | not-a-stream-variable | error | Operand '<operand>' to operator '<operator>' is not a stream variable. |
M5013 | notastreamvariable | error | Operand '<aText>' to operator '<fText>' is not a stream variable. |
M5014 | assignment-to-non-variable | error | Component '<componentName>' may not be assigned to due to class specialization '<specialization>'. |
M5015 | function-call-contains-subscripts | error | Function call <cref> contains subscripts. |
M5016 | tuple-subscript-not-allowed | error | Tuple expression can not be subscripted. |
M5017 | when-illegal-context | error | A when-statement may not be used inside a function or a while, if, or for-clause. |
M5017 | whenillegalcontext | error | A when-statement may not be used inside a function or a while, if, or for-clause. |
M5018 | reduction-invalid-expr-type | error | Invalid expression '<exprText>' of type <actualType> in <op> reduction, expected <expectedText>. |
M5019 | failed-to-deduce-dimension | error | Failed to deduce dimension <dimIdx> of <varName> due to missing binding equation. |
M5020 | output-not-definitely-assigned | error | Output variable '<varName>' in function '<funcName>' is not definitely assigned on all control flow paths. |
M5021 | uninitialized-variable-read | warning | Variable '<varName>' is read before being definitely assigned. |
M5022 | unreachable-statement | warning | Unreachable statement detected. |
M5023 | elsewhen-variable-mismatch | error | The same variables must be solved in elsewhen clause as in the when clause. |
M5023 | elsewhenvariablemismatch | error | The same variables must be solved in elsewhen clause as in the when clause. |
M5024 | reinit-type-mismatch | error | The first argument to reinit must be a subtype of Real, but <varName> has type <actualType>. |
M5025 | implicit-iterator-subscript-missing | error | Identifier <iterName> of implicit for iterator must be present as array subscript in the loop body. |
M5026 | implicit-iteration-dim-mismatch | error | Dimension <dim1> of <name1> and <dim2> of <name2> differs when trying to deduce implicit iteration range. |
M5027 | when-condition-not-discrete | error | When-condition '<condText>' is not a discrete-time expression. |
M5028 | when-if-branch-lhs-mismatch | error | The branches of an if-equation inside a when-equation must have the same set of component references on the left-hand side. |
M5029 | clocked-when-has-elsewhen | error | Clocked when equation can not contain elsewhen part. |
M5030 | clocked-when-branch-in-when | error | Clocked when branch in when equation. |
M5031 | invalid-when-lhs | error | Invalid left-hand side of when-equation: <lhsStr>. |
M5032 | when-conditional-expected-boolean | error | Type error in when conditional '<condStr>'. Expected Boolean scalar or vector, got Clock. |
M5033 | reinit-not-continuous | error | The first argument to reinit must be a continuous time variable, but <varName> is <variability>. |
M5034 | eval-external-builtin | error | Internal error NFCeval.evalBuiltinCall: unimplemented case for <funcName> |
M5035 | argument-not-differentiable | error | Argument '<argName>' of der is not differentiable. |
M5036 | invalid-size-index | error | Invalid index <dim> in call to size of <arrName>, valid index interval is [1,<maxDim>]. |
M5037 | function-no-named-parameter | error | Function <funcName> has no input parameter named <paramName>. |
M5038 | when-in-initial-equation | error | when-clause is not allowed in initial section. |
M5039 | size-first-arg-not-array | error | The first argument of size(<argText>) must be an array expression. |
M5040 | reinit-outside-when | error | Operator reinit may only be used in the body of a when equation. |
M5041 | reinit-in-algorithm | error | Operator reinit may not be used in an algorithm section (use translation flag --allowNonStandardModelica=reinitInAlgorithms to ignore). |
M5042 | reinit-arg1-not-variable | error | The first argument to reinit must be a variable of type Real or an array of such variables. |
M5043 | illegal-end-usage | error | 'end' can not be used outside array subscripts. |
M5044 | reinit-arg2-type-mismatch | error | Type mismatch for positional argument 2 in reinit(=<argText>). The argument has type: <actualType> expected type: <expectedType> |
M6001 | mixed-clock-domains | error | Clocked expression '<exprText>' mixes signals from different clock domains. |
M6001 | mixedclockdomains | error | Mixed clock domains in expression '<target>' without explicit conversion operator. |
M6002 | sample-factor-not-positive | error | Sub-clock factor must be a positive integer. |
M6002 | samplefactornotpositive | error | Sample factor '<target>' must be a positive non-zero integer. |
M6003 | previous-outside-clocked | error | Operator 'previous()' may only be applied to clocked discrete-time variables in '<exprText>'. |
M6003 | previousoutsideclocked | error | previous() can only be called on clocked discrete variables, but '<target>' is unclocked. |
M6004 | hold-in-continuous | error | Operator 'hold()' converts a clocked signal to continuous-time and cannot be used inside a clocked partition: '<exprText>'. |
M6004 | holdincontinuous | error | hold() operator cannot be called in continuous equation section without boundary causality. |
M6010 | duplicate-initial-state | error | A state machine partition must have at most one initialState() call. |
M6010 | duplicateinitialstate | error | More than one state marked as initialState in state machine '<target>'. |
M6020 | impure-called-in-pure | error | Impure function '<callText>' cannot be called inside a pure function. |
M6020 | impurecalledinpure | error | Pure function cannot call impure function '<target>'. |
M6021 | impure-in-equation-section | error | Impure function '<callText>' may only be called inside a when-equation or when-statement. |
M6021 | impureinequationsection | error | Impure function '<target>' may only be called in algorithm sections or when equations. |
M6040 | break-connection-not-found | error | Connection '<connText>' in 'break' modifier does not exist in base class. |
Generated from languages/modelica/src/errors.tslanguages/modelica/src/lints/index.ts. All languages →
Modelica MCP Server Tools (@modelscript/mcp)
The @modelscript/mcp server and @modelscript/modelica MCP adapter expose 9 Modelica domain tools (plus polyglot closed-loop synthesis and calibration tools) to AI agents:
| MCP Tool | Description |
|---|---|
modelica_load | Loads .mo files or Modelica Standard Library packages into the persistent workspace session |
modelica_parse | Parses Modelica source code with the WASM GLR parser and returns CST nodes and syntax diagnostics |
modelica_flatten | Flattens a Modelica class via ModelicaFlattener and returns the flat Modelica DAE representation |
modelica_lint | Runs all 307 semantic and structural lint rules on a Modelica file or package |
modelica_simulate | Flattens, runs BLT/index reduction, integrates the DAE over |
hybrid_simulate | Executes a hybrid continuous Modelica DAE + discrete-event DEVS simulation |
modelica_doe | Executes a multi-parameter Design of Experiments (Full Factorial / Latin Hypercube) batch sweep |
modelica_sensitivity | Computes local finite-difference or forward sensitivity matrices |
modelica_query | Queries the Salsa QueryEngine for class components, resolved types, variabilities, and modifications |
modelica_diff_calibrate | Calibrates Modelica parameters against target CSV trajectory data via L-BFGS / Adam gradient optimization |
SysML v2 Transformer & Polyglot TGG Rules
- Direct AST Transformer (
modelicaToSysML2inlanguages/modelica/src/transformers/sysml2.ts): Converts complete Modelica packages and models into idiomatic SysML v2 textual notation (part def,port def,attribute,connect). - 10 Bidirectional TGG Rules (
languages/modelica/src/language.ts):- Modelica
SysML v2 (6 rules): ModelicaModelToSysML2PartDef,ModelicaConnectorToSysML2PortDef,ModelicaComponentToSysML2Part,ModelicaParameterToSysML2Attribute,ModelicaConnectorInstanceToSysML2Port,ModelicaConnectToSysML2Connection - Modelica
OWL2 (2 rules): ModelicaModelToOWL2Class,ModelicaParameterToOWL2DataProperty - Modelica
STEP (2 rules): ModelicaRevoluteToStepRevolute,ModelicaPrismaticToStepPrismatic
- Modelica
Diagnostic Rules
307 rules281 error12 info2 notification12 warning Run with msx lint
| Code | Rule | Severity | Message |
|---|---|---|---|
M1000 | identity-arg-count | error | Wrong number of arguments to identity. |
M1001 | parse-error | error | Parse error. |
M1002 | parse-missing | error | Parse error: '<expected>' expected. |
M1003 | empty-array-constructor | error | Parse error: Empty array constructors are not valid in Modelica. |
M1003 | emptyarrayconstructor | error | Empty array constructor '<target>' is not valid in Modelica. |
M1004 | identity-first-arg-integer | error | First argument to identity in component <compName> must be Integer expression. |
M1005 | subscripted-modifier | error | Subscripting modifiers is not allowed. Apply the modification on the whole identifier using an array-expression or an each-modifier. |
M1099 | wasm-flattener-unsupported | error | [ModelicaFlattener] Model '<rootName>' could not be flattened using strict WASM backend. |
M2001 | duplicate-element | error | An element with name <name> is already declared in this scope. |
M2002 | variable-not-found | error | Variable <name> not found in scope <scope>. |
M2002 | variablenotfound | error | Variable <vName> not found in scope <className>. |
M2003 | class-not-found | error | Class <className> not found in scope <scope> (looking for a function or record). |
M2003 | typenotfound | error | Class or type '<fullType>' not found in scope. |
M2004 | modifier-not-found | error | In modifier of '<componentName>', class or component '<modName>' not found in '<className>'. |
M2005 | identifier-mismatch | error | The identifier at start and end are different. |
M2005 | identifiermismatch | error | Parse error: The identifier at start and end are different |
M2006 | modified-element-not-found | error | Modified element <modName> not found in class <className>. |
M2007 | modifier-class-not-found | error | In modifier (<modText>), class or component <modName> not found in <<className>>. |
M2011 | same-name-type-shadowing | error | Found a component with same name when looking for type <typeSpec>. |
M2012 | class-not-found-in-scope | error | Class <className> not found in scope <scope>. |
M2013 | base-class-not-found-in-scope | error | Base class <className> not found in scope <scope>. |
M2014 | partial-base-class | error | Part <partName> of base class name <extName> is not a class. |
M2015 | base-class-ambiguous | error | The base class name <partName> was found in one or more base classes: <candidateNames>. |
M2016 | base-class-found-in | error | <partName> was found in base class <baseName>. |
M2038 | partial-lookup-disallowed | error | <className> is partial, name lookup is not allowed in partial classes. |
M2090 | finaloverridenotification | info | From here: |
M2090 | from-here | notification | From here: |
M2091 | redeclare-final-component-notification | info | From here: |
M2091 | redeclarefinalcomponentnotification | info | From here: |
M2092 | redeclare-constant-component-notification | info | From here: |
M2092 | redeclareconstantcomponentnotification | info | From here: |
M2093 | duplicate-modification-notification | info | From here: |
M2093 | duplicatemodificationnotification | info | From here: |
M2094 | missing-inner | warning | No corresponding 'inner' declaration found for component .<typeName> <componentName> declared as 'outer'. The existing 'inner' components are: <inners> Check if you have not misspelled the 'outer' component name. Please declare an 'inner' component with the same name in the top scope. Continuing flattening by only considering the 'outer' component declaration. |
M2094 | missinginner | warning | No corresponding 'inner' declaration found in scope for outer component '<target>'. |
M2095 | from-here-trace | notification | From here: |
M2096 | redeclare-non-replaceable-notification | info | From here: |
M2096 | redeclarenonreplaceablenotification | info | From here: |
M2097 | protected-modification-notification | info | From here: |
M2097 | protectedmodificationnotification | info | From here: |
M3001 | type-mismatch-binding | error | Type mismatch in binding <componentName> = <actualExpr>, expected subtype of <expectedType>, got type <actualType>. |
M3001 | typemismatchbinding | error | Type mismatch in binding <target>, expected subtype of <expName>, got type <actName>. |
M3002 | type-mismatch-modifier | error | Type mismatch: '<modName>' expects type '<expectedType>' but got '<actualType>'. |
M3002 | typemismatchmodification | error | Type mismatch in binding or modification expression '<target>'. |
M3003 | not-plug-compatible | error | The connectors in connect(<ref1>, <ref2>) are not type compatible. |
M3004 | not-a-connector | error | <which> is not a valid connector. |
M3005 | redeclare-type-mismatch | error | Redeclare of '<redeclaredName>': type '<newType>' is not compatible with constraining type '<constrainingType>'. |
M3006 | function-arg-type-mismatch | error | Type mismatch for positional argument <argPosition> in <callExpr>. The argument has type: <argTypeSignature> expected type: <expectedTypeSignature> |
M3007 | connect-invalid-form | error | <ref> is not a valid form for a connector, connectors must be either c1.c2...cn or m.c (where c is a connector and m is a non-connector). |
M3008 | extends-type-mismatch | error | In extends of '<className>': redeclared '<redeclaredName>' of type '<newType>' is not compatible with original type '<originalType>'. |
M3009 | array-index-type-mismatch | error | Array index type mismatch: expected Integer or Boolean, but got '<actualType>'. |
M3009 | arrayindextypemismatch | error | Array index '<target>' has invalid type: expected Integer or Boolean. |
M3010 | unit-mismatch | warning | Unit mismatch: Left-hand side has unit '<lhsUnit>' but right-hand side has incompatible unit '<rhsUnit>'. |
M3010 | unitmismatchbinding | warning | Unit mismatch in equation '<target>'. |
M3010 | unitmismatchequation | warning | Unit mismatch in equation '<target>'. |
M3011 | binary-op-type-mismatch | error | Cannot resolve type of expression <expr>. The operands have types <type1>, <type2> in component <NO_COMPONENT>. |
M3012 | optimization-objective-type | error | Optimization objective must be a scalar Real, but got type '<typeStr>'. |
M3013 | optimization-constraint-type | error | Optimization constraints must evaluate to scalar Real or Boolean expressions, but got type '<typeStr>'. |
M3014 | builtin-attribute-type-mismatch | error | Type mismatch in binding <attrName> = <bindingText>, expected subtype of <expectedType>, got type <actualType>. |
M3015 | attribute-type-mismatch | error | Variable <varName>: Wrong type on builtin attribute <attrName> (type was: <actualType>, expected: <expectedType>). |
M3016 | conditional-type-mismatch | error | Type error in conditional '<condExpr>'. Expected Boolean, got <actualType>. |
M3017 | connect-types-inconsistent | error | The type of variables <r0Raw> type: <type0> and <r1Raw> type: <type1> are inconsistent in connect equations. |
M3018 | array-element-type-mismatch | error | Array constructor elements have inconsistent types in '<exprText>'. |
M3018 | arrayelementtypemismatch | error | Array element type mismatch in '<target>'. |
M3019 | no-matching-function | error | No matching function found for <callExpr> of type <callSig> candidates are <candidateSig> |
M3020 | type-mismatch-modifier-binding | error | Type mismatch in modifier of component <compName>, expected type <expectedType>, got modifier <exprText> of type <actualType>. |
M3021 | function-return-type-mismatch | error | Function '<funcName>' returns type '<actualType>' but '<expectedType>' expected. |
M4000 | dimension-not-parameter | error | Expression '<exprName>' that determines the size of dimension '<dim>' of '<callText>' is not an evaluable parameter expression. |
M4001 | extends-cycle | error | extends <baseName> causes an instantiation loop. |
M4001 | extendscycle | error | Extends cycle detected for '<target>'. |
M4002 | duplicate-modification | error | Duplicate modification of element <elementName> on <kind> <componentName>. |
M4002 | duplicatemodification | error | <outerName>.<innerOrKind> |
M4003 | array-dimension-mismatch | error | Type mismatch in binding '<componentName> = <exprText>', expected array dimensions [<expectedShape>], got [<actualShape>]. |
M4003 | arrayshapemismatch | error | Array shape mismatch: declared dimension does not match initializer element count in '<target>'. |
M4004 | unbalanced-model | warning | The <classKind> '<name>' is not balanced: <nEquations> equation(s) and <nVariables> variable(s). |
M4004 | unbalancedmodel | warning | Model '<target>' is not balanced: <value> equations for <value> variables. |
M4005 | protected-modification | error | Protected element '<elementName>' may not be modified, got '<modText>'. |
M4005 | protectedmodification | error | Protected element '<eName>' may not be modified, got '<mText>'. |
M4006 | external-with-algorithm | error | Element is not allowed in function context: algorithm |
M4006 | externalwithalgorithm | error | Element '<target>' is not allowed in function context with algorithm section. |
M4007 | function-public-variable | error | Invalid public variable <varName>, function variables that are not input/output must be protected. |
M4007 | functionpublicvariable | error | Invalid public variable <varName>, function variables that are not input/output must be protected. |
M4008 | array-subscript-count-mismatch | error | Wrong number of subscripts in <refStr> (<actualCount> subscripts for <expectedCount> dimensions). |
M4009 | function-default-arg-cycle | error | The default value of <paramName> causes a cyclic dependency. |
M4010 | function-invalid-var-type | error | Invalid type <typeName> for function component <varName>. |
M4011 | function-protected-io | error | Invalid protected variable <varName>, function variables that are input/output must be public. |
M4011 | functionprotectedio | error | Invalid protected variable <varName>, function variables that are input/output must be public. |
M4012 | function-arg-variability | error | Function argument <paramName>=<argExpr> in call to <funcName> has variability <actualVariability> which is not a <requiredVariability> expression. |
M4013 | nested-when-statement | error | Nested when statements are not allowed. |
M4013 | nestedwhen | error | Nested when statements are not allowed. |
M4014 | tuple-expression-context | error | Tuple expressions may only occur on the left side of an assignment or equation with a single function call on the right side. Got the following expression: <exprText>. |
M4014 | tupleexpressioncontext | error | Tuple expressions may only occur on the left side of an assignment or equation with a single function call on the right side. |
M4015 | within-in-script | error | The within directive is not allowed in script mode. |
M4016 | statement-in-standard-mode | error | Top-level statements are not allowed in standard Modelica mode. |
M4017 | restriction-violation | error | <what> are not allowed in <classKind>. |
M4017 | restrictionviolation | error | Algorithm sections are not allowed in <kindStr>. |
M4018 | partial-instantiation | error | Illegal to instantiate partial class <className>. |
M4019 | redeclare-non-replaceable | error | Redeclaration with a new type requires '<elementName>' to be replaceable. |
M4019 | redeclarenonreplaceable | error | Redeclaration with a new type requires '<eName>' to be replaceable. |
M4020 | builtin-time-invalid | error | time is not allowed in a function. |
M4020 | reservedbuiltintime | error | Identifier time is reserved for the built-in element with the same name. |
M4020 | timeinfunction | error | time is not allowed in a function. |
M4021 | range-step-too-small | error | Step size <stepSize> in range is too small. |
M4022 | enum-range-with-step | error | Range of type enumeration <enumType> may not specify a step size. |
M4022 | enumrangewithstep | error | Range of type enumeration '<target>' may not specify a step size. |
M4023 | connect-in-when | error | connect may not be used inside when-equations (found <connectExpr>). |
M4023 | connectinwhen | error | connect may not be used inside when-equations (found <target>). |
M4024 | connect-in-initial | error | Connect equations are not allowed in initial equation sections. |
M4024 | connectininitial | error | Connect equations are not allowed in initial equation sections. |
M4025 | connect-in-non-param-if | error | connect may not be used inside if-equations with non-parametric conditions (found <connectExpr>). |
M4025 | connectinnonparamif | error | connect may not be used inside if-equations with non-parametric conditions (found <target>). |
M4026 | final-override | error | Trying to override final element <elementName> with modifier '<modText>'. |
M4026 | finaloverride | error | Trying to override final element <eName> with modifier '<mText>'. |
M4027 | variability-binding-mismatch | error | Component <componentName> of variability <compVariability> has binding '<bindingExpr>' of higher variability <bindingVariability>. |
M4027 | variabilitybindingmismatch | error | Component <compName> of variability parameter has binding '<target>' of higher variability continuous. |
M4028 | partial-type-component | error | Component '<componentName>' has partial type '<typeName>'. |
M4028 | partialtypecomponent | error | Component '<target>' has partial type. |
M4029 | component-binding-restriction | error | Component '<componentName>' may not have a binding equation due to class specialization '<classKind>'. |
M4030 | outer-modifier | error | Modifier '<modText>' found on outer element <elementName>. |
M4030 | outermodifier | error | Modifier '<modNode>' found on outer element <nameNode>. |
M4031 | array-index-out-of-bounds | error | Subscript '<index>' for dimension <dimensionIndex> (size = <dimensionSize>) of <arrayName> is out of bounds. |
M4031 | arrayindexoutofbounds | error | Subscript 'index' for dimension <dimIndex> (size = <dimSize>) of array is out of bounds. |
M4032 | function-invalid-prefix | error | Invalid prefix <prefix> on formal parameter <varName>. |
M4032 | functioninvalidprefix | error | Invalid prefix '<target>' on formal parameter in function. |
M4033 | function-multiple-algorithm | error | Function <funcName> has more than one algorithm section or external declaration. |
M4033 | functionmultiplealgorithm | error | Function <name> has more than one algorithm section or external declaration. |
M4034 | replaceable-base-class | error | Class '<className>' in 'extends <extendsText>' is replaceable, the base class name must be transitively non-replaceable. |
M4034 | replaceablebaseclass | error | Class '<target>' in 'extends <target>' is replaceable, the base class name must be transitively non-replaceable. |
M4035 | cyclic-dimension-dependency | error | Dimension <dimNum> of <varName>, '<exprText>', could not be evaluated due to a cyclic dependency. |
M4036 | package-variable-not-constant | error | Variable <varName> in package <packageName> is not constant. |
M4037 | connector-variability | error | Invalid variability <variability> on connector '<connectorName>'. |
M4037 | connectorvariability | error | Invalid variability <pfx> on connector '<compName>'. |
M4038 | flow-outside-connector | warning | Prefix 'flow' used outside connector declaration. |
M4038 | flowoutsideconnector | warning | Prefix '<target>' used outside connector declaration. |
M4039 | discrete-not-on-lhs | error | Following variable is discrete, but does not appear on the LHS of a when-statement: '<varName>'. |
M4039 | discretenotonlhs | error | Following variable is discrete, but does not appear on the LHS of a when-statement: '<target>'. |
M4040 | protected-element-modification | error | Protected element '<varName>' may not be modified, got '<modText>'. |
M4041 | negative-dimension | error | Negative dimension index (<dim>) for component <varName>. |
M4041 | negativedimension | error | Negative dimension index (-1) for component component. |
M4042 | constant-has-no-value | error | Constant '<qualifiedName>' has no value. |
M4042 | constanthasnovalue | error | Constant '<target>' has no value. |
M4043 | constant-variability-violation | error | Component <componentName> of variability constant has binding '<bindingText>' of higher variability <bindingVariability>. |
M4043 | constantvariabilityviolation | error | Component <compName> of variability constant has binding '<target>' of higher variability <varbNode>. |
M4044 | non-array-modification | error | Non-array modification '<modText>' for array component '<componentName>', possibly due to missing 'each'. |
M4044 | nonarraymodification | error | Non-array modification '<fullMod>' for array component, possibly due to missing 'each'. |
M4045 | modified-element-not-found-cst | error | Modified element <modName> not found in class <className>. |
M4045 | modifiedelementnotfound | error | Modified element <eText> not found in class <tText>. |
M4046 | constant-not-fixed | error | Constant '<componentName>' must be fixed but has 'fixed = false' |
M4046 | constantnotfixed | error | Constant declaration '<target>' must be fixed. |
M4047 | cardinality-invalid-context | error | cardinality may only be used in the condition of an if-statement/equation or an assert. |
M4047 | cardinalityinvalidcontext | error | Operator '<target>' may only be used in the condition of an if-statement/equation or an assert. |
M4048 | cardinality-expected-component | error | Expected <name> to be a component, but found class instead. |
M4048 | cardinalityexpectedcomponent | error | Expected <target> to be a component, but found class instead. |
M4049 | break-on-non-component | error | Invalid use of break on non-component '<name>'. |
M4049 | breakonnoncomponent | error | Invalid use of break on non-component '<ident>'. |
M4050 | break-component-invalid-type | error | Invalid use of break on component '<name>', component must be a model, block, or connector. |
M4050 | breakcomponentinvalidtype | error | Invalid use of break on component '<ident>', component must be a model, block, or connector. |
M4051 | break-connect-not-found | error | No matching element found for '<connText>'. |
M4051 | breakconnectnotfound | error | No matching element found for '<target>'. |
M4052 | redeclare-final-component | error | Redeclaration of final component <name> is not allowed. |
M4052 | redeclarefinalcomponent | error | Redeclaration of final component <eName> is not allowed. |
M4053 | redeclare-constant-component | error | Redeclaration of constant component <name> is not allowed. |
M4053 | redeclareconstantcomponent | error | Redeclaration of constant component <eName> is not allowed. |
M4054 | stream-unbalanced-connector | error | Invalid stream connector <connectorName>: A stream connector must have exactly one flow variable, this connector has <flowCount> flow variables. |
M4054 | streamunbalancedconnector | error | Invalid stream connector .<cName>: A stream connector must have exactly one flow variable, this connector has <fCount> flow variables. |
M4055 | cannot-connect-expandable-with-non-expandable | error | Cannot connect expandable connector <expName> with non-expandable connector <nonExpName>. |
M4055 | cannotconnectexpandablewithnonexpandable | error | Cannot connect expandable connector <expRef> with non-expandable connector <nonExpRef>. |
M4056 | duplicate-inherited-element-not-identical | error | Duplicate elements (due to inherited elements) not identical: first element is: <currText> second element is: <prevText> |
M4057 | expandable-connector-flow-element | error | Prefix 'flow' on component '<compName>' not allowed in class specialization 'expandable connector'. |
M4057 | expandableconnectorflowelement | error | Prefix 'flow' on component '<compName>' not allowed in class specialization 'expandable connector'. |
M4058 | recursive-definition | error | Declaration of element <elemName> causes recursive definition of class <className>. |
M4059 | max-recursion-depth-exceeded | error | The maximum recursion depth of <depth> was reached, probably due to mutually recursive definitions. |
M4061 | redeclare-non-inherited | error | Illegal redeclare of element <elementName>, no inherited element with that name exists. |
M4061 | redeclarenoninherited | error | Illegal redeclare of element <eName>, no inherited element with that name exists. |
M4062 | invalid-external-object | error | External object <className> contains invalid element '<elemName>'. |
M4063 | class-extends-non-inherited | error | Base class targeted by class extends <className> not found in the inherited classes. |
M4063 | classextendsnoninherited | error | Invalid redeclaration of class <eName>, class extends only allowed on inherited classes. |
M4064 | protected-in-connector | error | Protected sections are not allowed in connector. |
M4064 | protectedinconnector | error | Protected sections are not allowed in <kindStr>. |
M4065 | equationinconnector | error | Equations are not allowed in connector. |
M4065 | equations-in-connector | error | Equations are not allowed in connector. |
M4066 | algorithm-in-connector | error | Algorithm sections are not allowed in connector. |
M4066 | algorithminconnector | error | Algorithm sections are not allowed in connector. |
M4067 | external-object-missing-constructor | error | External object <className> is missing a constructor. |
M4068 | redeclare-condition-attribute | error | Invalid redeclaration of <elementName>, a redeclare may not have a condition attribute. |
M4068 | redeclareconditionattribute | error | Invalid redeclaration of <eName>, a redeclare may not have a condition attribute. |
M4069 | external-object-return-restriction | error | Function <fnName> returns an external object, but the only function allowed to return this object is <extObjName>.constructor. |
M4070 | external-non-function | error | Class specialization violation: <className> is a <specialization>, which may not contain an external declaration. |
M4070 | externalnonfunction | error | Class specialization violation: <name> is a <kindStr>, which may not contain an external declaration. |
M4071 | external-invalid-language | error | '<lang>' is not a valid language for an external function. |
M4072 | external-invalid-arg-expr | error | Expression <expr> cannot be an external argument. Only identifiers, scalar constants, and size-expressions are allowed. |
M4073 | external-invalid-arg-size-const | error | Invalid external argument '<expr>', the dimension index must be a constant expression. |
M4074 | external-array-return-not-allowed | error | The lhs (result) of the external function declaration has array type (<typeStr>), but this is not allowed in the specification. You need to pass it as an input to the function (preferably also with a size()-expression to avoid out-of-bounds errors in the external call). |
M4075 | invalid-type-prefix-flow-nested | error | Invalid type prefix 'flow' on variable <varName>, due to existing type prefix 'flow'. |
M4076 | parameter-bound-contradiction | error | Contradictory bounds for parameter '<paramName>': lower bound '<lower>' exceeds upper bound '<upper>'. |
M4076 | parameterboundcontradiction | error | Contradictory bounds for parameter 'parameter': lower bound 'min' exceeds upper bound 'max'. |
M4077 | loop-termination-inconclusive | error | Loop over '<loopVar>' with condition '<condition>' cannot be proven to terminate. |
M4078 | terminate-in-function | error | terminate is not allowed in a function. |
M4078 | terminateinfunction | error | terminate is not allowed in a function. |
M4079 | return-outside-function | error | 'return' may not be used outside function. |
M4079 | returnoutsidefunction | error | 'return' may not be used outside function. |
M4080 | cyclic-constants-or-parameters | error | Cyclically dependent constants or parameters found in scope <scopeName>: {<cycleList>} (ignore with -d=ignoreCycles). |
M4081 | cyclic-function-components | error | Cyclically dependent function components found: {<cycleList>} |
M4082 | connector-non-parameter-subscript | error | Connector '<connRef>' has non-parameter subscript '<subscriptText>'. |
M4083 | enum-duplicate-literal | error | Enumeration has duplicate names: <dup> in list of names <list>. |
M4084 | enum-reserved-attribute-literal | error | Invalid use of reserved attribute name <name> as enumeration literal. |
M4091 | break-outside-loop | error | 'break' must be inside a for or while loop, or enclose a connect equation. |
M4091 | breakoutsideloop | error | 'break' may only be used in a while- or for-loop. |
M4092 | binding-dimension-mismatch | error | Type mismatch in binding '<componentName> = <bindingText>', expected array dimensions [<expectedDims>], got [<actualDims>]. |
M4093 | unused-input-variable | warning | Unused input variable <varName> in function <funcName>. |
M4094 | cardinality-in-condition-only | error | cardinality may only be used in the condition of an if-statement or if-equation. |
M4095 | conditional-expression-not-evaluated | error | The conditional expression <condText> could not be evaluated. |
M4096 | dimensions-must-be-parameter | error | Dimensions must be parameter or constant expression (in <callStr>). |
M4097 | called-function-partial | error | Called function '<fnName>' is partial. |
M4098 | class-specialization-violation | error | Class specialization violation: <className> <errorDetail>. |
M4099 | cannot-connect-undeclared-expandable-connectors | error | Cannot connect undeclared connectors <c1> with <c2>. At least one of them must be declared. |
M4101 | top-level-outer-element | error | The model can't be instantiated due to top-level outer element '<elementName>', it may only be used as part of a simulation model. |
M4102 | inner-not-found-existing-decl | error | An inner declaration for outer element '<elementName>' could not be found, and could not be automatically generated due to an existing declaration of that name. |
M4103 | missing-redeclare-keyword | error | Missing redeclare keyword on attempted redeclaration of class <className>. |
M4104 | invalid-redeclaration-class-as-component | error | Invalid redeclaration of class <className> as component. |
M4105 | duplicate-redeclare | error | <name> is already redeclared in this scope. |
M4106 | invalid-redeclaration-prefix | error | Invalid redeclaration '<newPrefix> <name>', original element is declared '<origPrefix>'. |
M4107 | invalid-redeclaration-component-as-class | error | Invalid redeclaration of component <compName> as class. |
M4108 | redeclare-enum-not-subtype-generic | error | Redeclaration of enumeration '<name>' is not a subtype of the redeclared element (use enumeration(:) for a generic replaceable enumeration). |
M4109 | redeclare-enum-not-subtype | error | Redeclaration of enumeration '<name>' is not a subtype of the redeclared element. |
M4110 | invalid-type-prefix-conflict | error | Invalid type prefix '<newPrefix>' on component <compName>, due to existing type prefix '<existingPrefix>'. |
M4111 | invalid-redeclaration-basic-type-attribute | error | Invalid redeclaration of <attrName>, attributes of basic types may not be redeclared. |
M4112 | extends-other-base-class | error | Found other base class for extends <baseName> after instantiating extends. |
M4113 | external-object-missing-destructor | error | External object <className> is missing a destructor. |
M4114 | invalid-connector-variability | error | Invalid variability <variability> on connector '<compName>'. |
M4115 | external-object-not-replaceable | error | '<elemName>' may not be replaceable. |
M4116 | operator-encapsulation | error | Operator <recordName>.'<opName>' is not encapsulated. |
M4117 | operator-constructor-outputs | error | Operator <recordName>.'constructor' must have exactly one output. |
M4118 | operator-constructor-output-type | error | Output '<outputName>' in operator <recordName>.'constructor' must be of type <recordName>, got type <actualType>. |
M4119 | variable-in-package-not-constant | error | Variable <varName> in package <pkgName> is not constant. |
M4120 | ambiguous-operator-overload | error | Ambiguous matching overloaded operator functions found for <exprText>. Candidates are: <candidatesText> |
M4121 | no-matching-operator-function | error | No matching function found for <callExprText>. Candidates are: <candidatesText> |
M4122 | cannot-resolve-operator-type | error | Cannot resolve type of expression <exprText>. The operands have types <leftType>, <rightType> in component <NO_COMPONENT>. |
M5001 | equation-type-mismatch | error | Type mismatch in equation <lhsExpanded>=<rhsExpanded> of type <lhsType>=<rhsType>. |
M5001 | equationtypemismatch | error | Type mismatch in equation <eqText2> of type <lName>=<rName>. |
M5002 | constrainedby-type-mismatch | error | Replaceable '<componentName>': default type '<defaultType>' is not compatible with constraining type '<constrainingType>'. |
M5003 | if-branch-type-mismatch | error | If-equation branch type mismatch: '<varName>' assigned type '<branchType>' but expected '<expectedType>'. |
M5004 | connect-flow-mismatch | error | Cannot connect flow component <flowComp> to non-flow component <nonFlowComp>. |
M5004 | connectflowmismatch | error | Cannot connect flow component <flowRef>.<elemIdent> to non-flow component <nonFlowRef>.<elemIdent>. |
M5005 | division-by-zero | error | Division by zero: <lhs> / 0. |
M5005 | divisionbyzero | error | Division by literal zero in '<target>'. |
M5006 | assignment-type-mismatch | error | Type mismatch in assignment in <target> := <source> of <targetType> := <sourceType> |
M5006 | assignmenttypemismatch | error | Type mismatch in assignment in <target> of <tName> := <vName> |
M5007 | for-iterator-not-1d | error | Iterator <iteratorName>, has type <shape>, but expected a 1D array expression. |
M5007 | foriteratornot1d | error | Iterator iterator, has type Real, but expected a 1D array expression. |
M5008 | assignment-to-constant | error | Trying to assign to constant component in <componentName> := <exprText> |
M5008 | assignmenttoconstant | error | Trying to assign to constant component <idNode>. |
M5009 | assignment-to-input | error | Trying to assign to input component '<componentName>'. |
M5009 | assignmenttoinput | error | Trying to assign to input component <idNode>. |
M5010 | homotopy-recommended | info | Equation contains steep nonlinearity '<term>' without homotopy. Consider wrapping with homotopy(actual, simplified). |
M5011 | assignment-to-parameter | error | Trying to assign to parameter component in <componentName> := <exprText> |
M5012 | assignment-to-iterator | error | Assignment to iterator '<iteratorName>'. |
M5013 | not-a-stream-variable | error | Operand '<operand>' to operator '<operator>' is not a stream variable. |
M5013 | notastreamvariable | error | Operand '<aText>' to operator '<fText>' is not a stream variable. |
M5014 | assignment-to-non-variable | error | Component '<componentName>' may not be assigned to due to class specialization '<specialization>'. |
M5015 | function-call-contains-subscripts | error | Function call <cref> contains subscripts. |
M5016 | tuple-subscript-not-allowed | error | Tuple expression can not be subscripted. |
M5017 | when-illegal-context | error | A when-statement may not be used inside a function or a while, if, or for-clause. |
M5017 | whenillegalcontext | error | A when-statement may not be used inside a function or a while, if, or for-clause. |
M5018 | reduction-invalid-expr-type | error | Invalid expression '<exprText>' of type <actualType> in <op> reduction, expected <expectedText>. |
M5019 | failed-to-deduce-dimension | error | Failed to deduce dimension <dimIdx> of <varName> due to missing binding equation. |
M5020 | output-not-definitely-assigned | error | Output variable '<varName>' in function '<funcName>' is not definitely assigned on all control flow paths. |
M5021 | uninitialized-variable-read | warning | Variable '<varName>' is read before being definitely assigned. |
M5022 | unreachable-statement | warning | Unreachable statement detected. |
M5023 | elsewhen-variable-mismatch | error | The same variables must be solved in elsewhen clause as in the when clause. |
M5023 | elsewhenvariablemismatch | error | The same variables must be solved in elsewhen clause as in the when clause. |
M5024 | reinit-type-mismatch | error | The first argument to reinit must be a subtype of Real, but <varName> has type <actualType>. |
M5025 | implicit-iterator-subscript-missing | error | Identifier <iterName> of implicit for iterator must be present as array subscript in the loop body. |
M5026 | implicit-iteration-dim-mismatch | error | Dimension <dim1> of <name1> and <dim2> of <name2> differs when trying to deduce implicit iteration range. |
M5027 | when-condition-not-discrete | error | When-condition '<condText>' is not a discrete-time expression. |
M5028 | when-if-branch-lhs-mismatch | error | The branches of an if-equation inside a when-equation must have the same set of component references on the left-hand side. |
M5029 | clocked-when-has-elsewhen | error | Clocked when equation can not contain elsewhen part. |
M5030 | clocked-when-branch-in-when | error | Clocked when branch in when equation. |
M5031 | invalid-when-lhs | error | Invalid left-hand side of when-equation: <lhsStr>. |
M5032 | when-conditional-expected-boolean | error | Type error in when conditional '<condStr>'. Expected Boolean scalar or vector, got Clock. |
M5033 | reinit-not-continuous | error | The first argument to reinit must be a continuous time variable, but <varName> is <variability>. |
M5034 | eval-external-builtin | error | Internal error NFCeval.evalBuiltinCall: unimplemented case for <funcName> |
M5035 | argument-not-differentiable | error | Argument '<argName>' of der is not differentiable. |
M5036 | invalid-size-index | error | Invalid index <dim> in call to size of <arrName>, valid index interval is [1,<maxDim>]. |
M5037 | function-no-named-parameter | error | Function <funcName> has no input parameter named <paramName>. |
M5038 | when-in-initial-equation | error | when-clause is not allowed in initial section. |
M5039 | size-first-arg-not-array | error | The first argument of size(<argText>) must be an array expression. |
M5040 | reinit-outside-when | error | Operator reinit may only be used in the body of a when equation. |
M5041 | reinit-in-algorithm | error | Operator reinit may not be used in an algorithm section (use translation flag --allowNonStandardModelica=reinitInAlgorithms to ignore). |
M5042 | reinit-arg1-not-variable | error | The first argument to reinit must be a variable of type Real or an array of such variables. |
M5043 | illegal-end-usage | error | 'end' can not be used outside array subscripts. |
M5044 | reinit-arg2-type-mismatch | error | Type mismatch for positional argument 2 in reinit(=<argText>). The argument has type: <actualType> expected type: <expectedType> |
M6001 | mixed-clock-domains | error | Clocked expression '<exprText>' mixes signals from different clock domains. |
M6001 | mixedclockdomains | error | Mixed clock domains in expression '<target>' without explicit conversion operator. |
M6002 | sample-factor-not-positive | error | Sub-clock factor must be a positive integer. |
M6002 | samplefactornotpositive | error | Sample factor '<target>' must be a positive non-zero integer. |
M6003 | previous-outside-clocked | error | Operator 'previous()' may only be applied to clocked discrete-time variables in '<exprText>'. |
M6003 | previousoutsideclocked | error | previous() can only be called on clocked discrete variables, but '<target>' is unclocked. |
M6004 | hold-in-continuous | error | Operator 'hold()' converts a clocked signal to continuous-time and cannot be used inside a clocked partition: '<exprText>'. |
M6004 | holdincontinuous | error | hold() operator cannot be called in continuous equation section without boundary causality. |
M6010 | duplicate-initial-state | error | A state machine partition must have at most one initialState() call. |
M6010 | duplicateinitialstate | error | More than one state marked as initialState in state machine '<target>'. |
M6020 | impure-called-in-pure | error | Impure function '<callText>' cannot be called inside a pure function. |
M6020 | impurecalledinpure | error | Pure function cannot call impure function '<target>'. |
M6021 | impure-in-equation-section | error | Impure function '<callText>' may only be called inside a when-equation or when-statement. |
M6021 | impureinequationsection | error | Impure function '<target>' may only be called in algorithm sections or when equations. |
M6040 | break-connection-not-found | error | Connection '<connText>' in 'break' modifier does not exist in base class. |
Generated from languages/modelica/src/errors.tslanguages/modelica/src/lints/index.ts. All languages →

