Skip to content
Stable.mo@modelscript/modelica 307 diagnostic rules
Parser WASM GLR
Diagnostics 307 rules
DAE Arena Lowering
Simulation Native Solvers
Projections DAE, C, FMU
Live ExampleChuaNonlinearCircuit.mo

Chua's Chaotic RLC & Piecewise-Linear Circuit

Standard Modelica 3.x acausal electrical network with linear passives, gyrator inductance, and a piecewise-linear active Chua diode.

Playground
Source (18 lines)
1model ChuaNonlinearCircuit "Chua's chaotic oscillator circuit"
2  parameter Real C1 = 10.0 "Capacitor C1 [F]";
3  parameter Real C2 = 100.0 "Capacitor C2 [F]";
4  parameter Real L = 18.0 "Inductor L [H]";
5  parameter Real G = 0.7 "Conductance R [S]";
6  parameter Real Ga = -0.757576 "Inner diode slope [S]";
7  parameter Real Gb = -0.409091 "Outer diode slope [S]";
8 
9  Real v1(start = 0.15) "Voltage across C1 [V]";
10  Real v2(start = 0.0) "Voltage across C2 [V]";
11  Real iL(start = 0.0) "Inductor current [A]";
12  Real i_nl "Nonlinear Chua diode current [A]";
13equation
14  i_nl = Gb * v1 + 0.5 * (Ga - Gb) * (abs(v1 + 1.0) - abs(v1 - 1.0));
15  C1 * der(v1) = G * (v2 - v1) - i_nl;
16  C2 * der(v2) = G * (v1 - v2) + iL;
17  L * der(iL) = -v2;
18end ChuaNonlinearCircuit;
Acausal Electrical Schematic
iL v2 G(v2-v1) i_nl(v1) «inductor» Inductor L «parameters» L = 18.0 H iL(start = 0.0 A) «capacitor» Capacitor C2 «parameters» C2 = 100.0 F v2(start = 0.0 V) «conductor» Conductance G «parameters» G = 0.7 S «capacitor» Capacitor C1 «parameters» C1 = 10.0 F v1(start = 0.15 V) «nonlinearresistor» ChuaDiode NR «parameters» Ga = -0.758 S Gb = -0.409 S
Drag to pan · Click % to reset

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 ​

Rendering diagram...

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 / outer dynamic scoping, and deep hierarchical class modifications
  • Equations & Algorithms: Differential equations (der(x)), connect(a, b) (both potential/flow and stream connectors), if/for/when equations, initial equation, and imperative algorithm / initial algorithm sections
  • 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:

  1. Embedded 3D CSG & STEP Export (shape-flattener.ts, csg.ts, cad.ts):
    • ShapeFlattener extracts Modelica.Mechanics.MultiBody.Visualizers.FixedShape components, parametric dimensions, and Placement transformations 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 the modelscript/exportShapeToStep LSP command.
  2. 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.
  3. Octagon Abstract Interpretation & Formal Safety Verification (src/formal/):
    • ModelicaCfgLowerer (modelica-cfg-lowerer.ts), ModelicaAbstractEvaluator (modelica-abstract-evaluator.ts), and ModelicaStaticAnalyzer (modelica-analyzer.ts) lower flattened DAE equations and algorithm statements into relational Control Flow Graphs evaluated over the Octagon Abstract Domain (±xi±xj≤c).
    • PhysicalInvariantBridge (physical-invariant-bridge.ts) proves division-by-zero freedom, square-root/logarithm domain safety, and physical state invariants (domain.octagon()).
  4. Gettext .po / .pot Internationalization (po.ts):
    • Extracts translatable description strings and Dialog/Documentation annotations into GNU Gettext .pot templates and merges localized .po catalogs (npx msx i18n).

Semantic Linter (languages/modelica/src/lints/) ​

ModelScript enforces 307 OpenModelica-compatible diagnostic rules across six modular analyzers:

ModuleRepresentative Checks
syntax-placement.tsM1001–M1003: Parse errors, missing tokens, empty array constructors
queries.tsM2001–M2005: Duplicate elements, unresolved variables/classes/modifiers, identifier mismatches
types-expressions.tsM3001–M3006: Binding/modifier/argument type mismatches, array dimension checks
hierarchy-variability.tsM4001–M4005: Circular extends, duplicate modifications, protected access violations, variability ordering
connections-streams.tsM3003–M3004: Connector plug-compatibility, stream connector rules, cardinality checks
synchronous-clocks.ts & cfa.tsClock partitioning rules, uninitialized discrete variables, structural singularity diagnostics

307 rules281 error12 info2 notification12 warning Run with msx lint

CodeRuleSeverityMessage
M1000identity-arg-counterrorWrong number of arguments to identity.
M1001parse-errorerrorParse error.
M1002parse-missingerrorParse error: '<expected>' expected.
M1003empty-array-constructorerrorParse error: Empty array constructors are not valid in Modelica.
M1003emptyarrayconstructorerrorEmpty array constructor '<target>' is not valid in Modelica.
M1004identity-first-arg-integererrorFirst argument to identity in component <compName> must be Integer expression.
M1005subscripted-modifiererrorSubscripting modifiers is not allowed. Apply the modification on the whole identifier using an array-expression or an each-modifier.
M1099wasm-flattener-unsupportederror[ModelicaFlattener] Model '<rootName>' could not be flattened using strict WASM backend.
M2001duplicate-elementerrorAn element with name <name> is already declared in this scope.
M2002variable-not-founderrorVariable <name> not found in scope <scope>.
M2002variablenotfounderrorVariable <vName> not found in scope <className>.
M2003class-not-founderrorClass <className> not found in scope <scope> (looking for a function or record).
M2003typenotfounderrorClass or type '<fullType>' not found in scope.
M2004modifier-not-founderrorIn modifier of '<componentName>', class or component '<modName>' not found in '<className>'.
M2005identifier-mismatcherrorThe identifier at start and end are different.
M2005identifiermismatcherrorParse error: The identifier at start and end are different
M2006modified-element-not-founderrorModified element <modName> not found in class <className>.
M2007modifier-class-not-founderrorIn modifier (<modText>), class or component <modName> not found in <<className>>.
M2011same-name-type-shadowingerrorFound a component with same name when looking for type <typeSpec>.
M2012class-not-found-in-scopeerrorClass <className> not found in scope <scope>.
M2013base-class-not-found-in-scopeerrorBase class <className> not found in scope <scope>.
M2014partial-base-classerrorPart <partName> of base class name <extName> is not a class.
M2015base-class-ambiguouserrorThe base class name <partName> was found in one or more base classes: <candidateNames>.
M2016base-class-found-inerror<partName> was found in base class <baseName>.
M2038partial-lookup-disallowederror<className> is partial, name lookup is not allowed in partial classes.
M2090finaloverridenotificationinfoFrom here:
M2090from-herenotificationFrom here:
M2091redeclare-final-component-notificationinfoFrom here:
M2091redeclarefinalcomponentnotificationinfoFrom here:
M2092redeclare-constant-component-notificationinfoFrom here:
M2092redeclareconstantcomponentnotificationinfoFrom here:
M2093duplicate-modification-notificationinfoFrom here:
M2093duplicatemodificationnotificationinfoFrom here:
M2094missing-innerwarningNo 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.
M2094missinginnerwarningNo corresponding 'inner' declaration found in scope for outer component '<target>'.
M2095from-here-tracenotificationFrom here:
M2096redeclare-non-replaceable-notificationinfoFrom here:
M2096redeclarenonreplaceablenotificationinfoFrom here:
M2097protected-modification-notificationinfoFrom here:
M2097protectedmodificationnotificationinfoFrom here:
M3001type-mismatch-bindingerrorType mismatch in binding <componentName> = <actualExpr>, expected subtype of <expectedType>, got type <actualType>.
M3001typemismatchbindingerrorType mismatch in binding <target>, expected subtype of <expName>, got type <actName>.
M3002type-mismatch-modifiererrorType mismatch: '<modName>' expects type '<expectedType>' but got '<actualType>'.
M3002typemismatchmodificationerrorType mismatch in binding or modification expression '<target>'.
M3003not-plug-compatibleerrorThe connectors in connect(<ref1>, <ref2>) are not type compatible.
M3004not-a-connectorerror<which> is not a valid connector.
M3005redeclare-type-mismatcherrorRedeclare of '<redeclaredName>': type '<newType>' is not compatible with constraining type '<constrainingType>'.
M3006function-arg-type-mismatcherrorType mismatch for positional argument <argPosition> in <callExpr>. The argument has type: <argTypeSignature> expected type: <expectedTypeSignature>
M3007connect-invalid-formerror<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).
M3008extends-type-mismatcherrorIn extends of '<className>': redeclared '<redeclaredName>' of type '<newType>' is not compatible with original type '<originalType>'.
M3009array-index-type-mismatcherrorArray index type mismatch: expected Integer or Boolean, but got '<actualType>'.
M3009arrayindextypemismatcherrorArray index '<target>' has invalid type: expected Integer or Boolean.
M3010unit-mismatchwarningUnit mismatch: Left-hand side has unit '<lhsUnit>' but right-hand side has incompatible unit '<rhsUnit>'.
M3010unitmismatchbindingwarningUnit mismatch in equation '<target>'.
M3010unitmismatchequationwarningUnit mismatch in equation '<target>'.
M3011binary-op-type-mismatcherrorCannot resolve type of expression <expr>. The operands have types <type1>, <type2> in component <NO_COMPONENT>.
M3012optimization-objective-typeerrorOptimization objective must be a scalar Real, but got type '<typeStr>'.
M3013optimization-constraint-typeerrorOptimization constraints must evaluate to scalar Real or Boolean expressions, but got type '<typeStr>'.
M3014builtin-attribute-type-mismatcherrorType mismatch in binding <attrName> = <bindingText>, expected subtype of <expectedType>, got type <actualType>.
M3015attribute-type-mismatcherrorVariable <varName>: Wrong type on builtin attribute <attrName> (type was: <actualType>, expected: <expectedType>).
M3016conditional-type-mismatcherrorType error in conditional '<condExpr>'. Expected Boolean, got <actualType>.
M3017connect-types-inconsistenterrorThe type of variables <r0Raw> type: <type0> and <r1Raw> type: <type1> are inconsistent in connect equations.
M3018array-element-type-mismatcherrorArray constructor elements have inconsistent types in '<exprText>'.
M3018arrayelementtypemismatcherrorArray element type mismatch in '<target>'.
M3019no-matching-functionerrorNo matching function found for <callExpr> of type <callSig> candidates are <candidateSig>
M3020type-mismatch-modifier-bindingerrorType mismatch in modifier of component <compName>, expected type <expectedType>, got modifier <exprText> of type <actualType>.
M3021function-return-type-mismatcherrorFunction '<funcName>' returns type '<actualType>' but '<expectedType>' expected.
M4000dimension-not-parametererrorExpression '<exprName>' that determines the size of dimension '<dim>' of '<callText>' is not an evaluable parameter expression.
M4001extends-cycleerrorextends <baseName> causes an instantiation loop.
M4001extendscycleerrorExtends cycle detected for '<target>'.
M4002duplicate-modificationerrorDuplicate modification of element <elementName> on <kind> <componentName>.
M4002duplicatemodificationerror<outerName>.<innerOrKind>
M4003array-dimension-mismatcherrorType mismatch in binding '<componentName> = <exprText>', expected array dimensions [<expectedShape>], got [<actualShape>].
M4003arrayshapemismatcherrorArray shape mismatch: declared dimension does not match initializer element count in '<target>'.
M4004unbalanced-modelwarningThe <classKind> '<name>' is not balanced: <nEquations> equation(s) and <nVariables> variable(s).
M4004unbalancedmodelwarningModel '<target>' is not balanced: <value> equations for <value> variables.
M4005protected-modificationerrorProtected element '<elementName>' may not be modified, got '<modText>'.
M4005protectedmodificationerrorProtected element '<eName>' may not be modified, got '<mText>'.
M4006external-with-algorithmerrorElement is not allowed in function context: algorithm
M4006externalwithalgorithmerrorElement '<target>' is not allowed in function context with algorithm section.
M4007function-public-variableerrorInvalid public variable <varName>, function variables that are not input/output must be protected.
M4007functionpublicvariableerrorInvalid public variable <varName>, function variables that are not input/output must be protected.
M4008array-subscript-count-mismatcherrorWrong number of subscripts in <refStr> (<actualCount> subscripts for <expectedCount> dimensions).
M4009function-default-arg-cycleerrorThe default value of <paramName> causes a cyclic dependency.
M4010function-invalid-var-typeerrorInvalid type <typeName> for function component <varName>.
M4011function-protected-ioerrorInvalid protected variable <varName>, function variables that are input/output must be public.
M4011functionprotectedioerrorInvalid protected variable <varName>, function variables that are input/output must be public.
M4012function-arg-variabilityerrorFunction argument <paramName>=<argExpr> in call to <funcName> has variability <actualVariability> which is not a <requiredVariability> expression.
M4013nested-when-statementerrorNested when statements are not allowed.
M4013nestedwhenerrorNested when statements are not allowed.
M4014tuple-expression-contexterrorTuple 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>.
M4014tupleexpressioncontexterrorTuple expressions may only occur on the left side of an assignment or equation with a single function call on the right side.
M4015within-in-scripterrorThe within directive is not allowed in script mode.
M4016statement-in-standard-modeerrorTop-level statements are not allowed in standard Modelica mode.
M4017restriction-violationerror<what> are not allowed in <classKind>.
M4017restrictionviolationerrorAlgorithm sections are not allowed in <kindStr>.
M4018partial-instantiationerrorIllegal to instantiate partial class <className>.
M4019redeclare-non-replaceableerrorRedeclaration with a new type requires '<elementName>' to be replaceable.
M4019redeclarenonreplaceableerrorRedeclaration with a new type requires '<eName>' to be replaceable.
M4020builtin-time-invaliderrortime is not allowed in a function.
M4020reservedbuiltintimeerrorIdentifier time is reserved for the built-in element with the same name.
M4020timeinfunctionerrortime is not allowed in a function.
M4021range-step-too-smallerrorStep size <stepSize> in range is too small.
M4022enum-range-with-steperrorRange of type enumeration <enumType> may not specify a step size.
M4022enumrangewithsteperrorRange of type enumeration '<target>' may not specify a step size.
M4023connect-in-whenerrorconnect may not be used inside when-equations (found <connectExpr>).
M4023connectinwhenerrorconnect may not be used inside when-equations (found <target>).
M4024connect-in-initialerrorConnect equations are not allowed in initial equation sections.
M4024connectininitialerrorConnect equations are not allowed in initial equation sections.
M4025connect-in-non-param-iferrorconnect may not be used inside if-equations with non-parametric conditions (found <connectExpr>).
M4025connectinnonparamiferrorconnect may not be used inside if-equations with non-parametric conditions (found <target>).
M4026final-overrideerrorTrying to override final element <elementName> with modifier '<modText>'.
M4026finaloverrideerrorTrying to override final element <eName> with modifier '<mText>'.
M4027variability-binding-mismatcherrorComponent <componentName> of variability <compVariability> has binding '<bindingExpr>' of higher variability <bindingVariability>.
M4027variabilitybindingmismatcherrorComponent <compName> of variability parameter has binding '<target>' of higher variability continuous.
M4028partial-type-componenterrorComponent '<componentName>' has partial type '<typeName>'.
M4028partialtypecomponenterrorComponent '<target>' has partial type.
M4029component-binding-restrictionerrorComponent '<componentName>' may not have a binding equation due to class specialization '<classKind>'.
M4030outer-modifiererrorModifier '<modText>' found on outer element <elementName>.
M4030outermodifiererrorModifier '<modNode>' found on outer element <nameNode>.
M4031array-index-out-of-boundserrorSubscript '<index>' for dimension <dimensionIndex> (size = <dimensionSize>) of <arrayName> is out of bounds.
M4031arrayindexoutofboundserrorSubscript 'index' for dimension <dimIndex> (size = <dimSize>) of array is out of bounds.
M4032function-invalid-prefixerrorInvalid prefix <prefix> on formal parameter <varName>.
M4032functioninvalidprefixerrorInvalid prefix '<target>' on formal parameter in function.
M4033function-multiple-algorithmerrorFunction <funcName> has more than one algorithm section or external declaration.
M4033functionmultiplealgorithmerrorFunction <name> has more than one algorithm section or external declaration.
M4034replaceable-base-classerrorClass '<className>' in 'extends <extendsText>' is replaceable, the base class name must be transitively non-replaceable.
M4034replaceablebaseclasserrorClass '<target>' in 'extends <target>' is replaceable, the base class name must be transitively non-replaceable.
M4035cyclic-dimension-dependencyerrorDimension <dimNum> of <varName>, '<exprText>', could not be evaluated due to a cyclic dependency.
M4036package-variable-not-constanterrorVariable <varName> in package <packageName> is not constant.
M4037connector-variabilityerrorInvalid variability <variability> on connector '<connectorName>'.
M4037connectorvariabilityerrorInvalid variability <pfx> on connector '<compName>'.
M4038flow-outside-connectorwarningPrefix 'flow' used outside connector declaration.
M4038flowoutsideconnectorwarningPrefix '<target>' used outside connector declaration.
M4039discrete-not-on-lhserrorFollowing variable is discrete, but does not appear on the LHS of a when-statement: '<varName>'.
M4039discretenotonlhserrorFollowing variable is discrete, but does not appear on the LHS of a when-statement: '<target>'.
M4040protected-element-modificationerrorProtected element '<varName>' may not be modified, got '<modText>'.
M4041negative-dimensionerrorNegative dimension index (<dim>) for component <varName>.
M4041negativedimensionerrorNegative dimension index (-1) for component component.
M4042constant-has-no-valueerrorConstant '<qualifiedName>' has no value.
M4042constanthasnovalueerrorConstant '<target>' has no value.
M4043constant-variability-violationerrorComponent <componentName> of variability constant has binding '<bindingText>' of higher variability <bindingVariability>.
M4043constantvariabilityviolationerrorComponent <compName> of variability constant has binding '<target>' of higher variability <varbNode>.
M4044non-array-modificationerrorNon-array modification '<modText>' for array component '<componentName>', possibly due to missing 'each'.
M4044nonarraymodificationerrorNon-array modification '<fullMod>' for array component, possibly due to missing 'each'.
M4045modified-element-not-found-csterrorModified element <modName> not found in class <className>.
M4045modifiedelementnotfounderrorModified element <eText> not found in class <tText>.
M4046constant-not-fixederrorConstant '<componentName>' must be fixed but has 'fixed = false'
M4046constantnotfixederrorConstant declaration '<target>' must be fixed.
M4047cardinality-invalid-contexterrorcardinality may only be used in the condition of an if-statement/equation or an assert.
M4047cardinalityinvalidcontexterrorOperator '<target>' may only be used in the condition of an if-statement/equation or an assert.
M4048cardinality-expected-componenterrorExpected <name> to be a component, but found class instead.
M4048cardinalityexpectedcomponenterrorExpected <target> to be a component, but found class instead.
M4049break-on-non-componenterrorInvalid use of break on non-component '<name>'.
M4049breakonnoncomponenterrorInvalid use of break on non-component '<ident>'.
M4050break-component-invalid-typeerrorInvalid use of break on component '<name>', component must be a model, block, or connector.
M4050breakcomponentinvalidtypeerrorInvalid use of break on component '<ident>', component must be a model, block, or connector.
M4051break-connect-not-founderrorNo matching element found for '<connText>'.
M4051breakconnectnotfounderrorNo matching element found for '<target>'.
M4052redeclare-final-componenterrorRedeclaration of final component <name> is not allowed.
M4052redeclarefinalcomponenterrorRedeclaration of final component <eName> is not allowed.
M4053redeclare-constant-componenterrorRedeclaration of constant component <name> is not allowed.
M4053redeclareconstantcomponenterrorRedeclaration of constant component <eName> is not allowed.
M4054stream-unbalanced-connectorerrorInvalid stream connector <connectorName>: A stream connector must have exactly one flow variable, this connector has <flowCount> flow variables.
M4054streamunbalancedconnectorerrorInvalid stream connector .<cName>: A stream connector must have exactly one flow variable, this connector has <fCount> flow variables.
M4055cannot-connect-expandable-with-non-expandableerrorCannot connect expandable connector <expName> with non-expandable connector <nonExpName>.
M4055cannotconnectexpandablewithnonexpandableerrorCannot connect expandable connector <expRef> with non-expandable connector <nonExpRef>.
M4056duplicate-inherited-element-not-identicalerrorDuplicate elements (due to inherited elements) not identical: first element is: <currText> second element is: <prevText>
M4057expandable-connector-flow-elementerrorPrefix 'flow' on component '<compName>' not allowed in class specialization 'expandable connector'.
M4057expandableconnectorflowelementerrorPrefix 'flow' on component '<compName>' not allowed in class specialization 'expandable connector'.
M4058recursive-definitionerrorDeclaration of element <elemName> causes recursive definition of class <className>.
M4059max-recursion-depth-exceedederrorThe maximum recursion depth of <depth> was reached, probably due to mutually recursive definitions.
M4061redeclare-non-inheritederrorIllegal redeclare of element <elementName>, no inherited element with that name exists.
M4061redeclarenoninheritederrorIllegal redeclare of element <eName>, no inherited element with that name exists.
M4062invalid-external-objecterrorExternal object <className> contains invalid element '<elemName>'.
M4063class-extends-non-inheritederrorBase class targeted by class extends <className> not found in the inherited classes.
M4063classextendsnoninheritederrorInvalid redeclaration of class <eName>, class extends only allowed on inherited classes.
M4064protected-in-connectorerrorProtected sections are not allowed in connector.
M4064protectedinconnectorerrorProtected sections are not allowed in <kindStr>.
M4065equationinconnectorerrorEquations are not allowed in connector.
M4065equations-in-connectorerrorEquations are not allowed in connector.
M4066algorithm-in-connectorerrorAlgorithm sections are not allowed in connector.
M4066algorithminconnectorerrorAlgorithm sections are not allowed in connector.
M4067external-object-missing-constructorerrorExternal object <className> is missing a constructor.
M4068redeclare-condition-attributeerrorInvalid redeclaration of <elementName>, a redeclare may not have a condition attribute.
M4068redeclareconditionattributeerrorInvalid redeclaration of <eName>, a redeclare may not have a condition attribute.
M4069external-object-return-restrictionerrorFunction <fnName> returns an external object, but the only function allowed to return this object is <extObjName>.constructor.
M4070external-non-functionerrorClass specialization violation: <className> is a <specialization>, which may not contain an external declaration.
M4070externalnonfunctionerrorClass specialization violation: <name> is a <kindStr>, which may not contain an external declaration.
M4071external-invalid-languageerror'<lang>' is not a valid language for an external function.
M4072external-invalid-arg-exprerrorExpression <expr> cannot be an external argument. Only identifiers, scalar constants, and size-expressions are allowed.
M4073external-invalid-arg-size-consterrorInvalid external argument '<expr>', the dimension index must be a constant expression.
M4074external-array-return-not-allowederrorThe 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).
M4075invalid-type-prefix-flow-nestederrorInvalid type prefix 'flow' on variable <varName>, due to existing type prefix 'flow'.
M4076parameter-bound-contradictionerrorContradictory bounds for parameter '<paramName>': lower bound '<lower>' exceeds upper bound '<upper>'.
M4076parameterboundcontradictionerrorContradictory bounds for parameter 'parameter': lower bound 'min' exceeds upper bound 'max'.
M4077loop-termination-inconclusiveerrorLoop over '<loopVar>' with condition '<condition>' cannot be proven to terminate.
M4078terminate-in-functionerrorterminate is not allowed in a function.
M4078terminateinfunctionerrorterminate is not allowed in a function.
M4079return-outside-functionerror'return' may not be used outside function.
M4079returnoutsidefunctionerror'return' may not be used outside function.
M4080cyclic-constants-or-parameterserrorCyclically dependent constants or parameters found in scope <scopeName>: {<cycleList>} (ignore with -d=ignoreCycles).
M4081cyclic-function-componentserrorCyclically dependent function components found: {<cycleList>}
M4082connector-non-parameter-subscripterrorConnector '<connRef>' has non-parameter subscript '<subscriptText>'.
M4083enum-duplicate-literalerrorEnumeration has duplicate names: <dup> in list of names <list>.
M4084enum-reserved-attribute-literalerrorInvalid use of reserved attribute name <name> as enumeration literal.
M4091break-outside-looperror'break' must be inside a for or while loop, or enclose a connect equation.
M4091breakoutsidelooperror'break' may only be used in a while- or for-loop.
M4092binding-dimension-mismatcherrorType mismatch in binding '<componentName> = <bindingText>', expected array dimensions [<expectedDims>], got [<actualDims>].
M4093unused-input-variablewarningUnused input variable <varName> in function <funcName>.
M4094cardinality-in-condition-onlyerrorcardinality may only be used in the condition of an if-statement or if-equation.
M4095conditional-expression-not-evaluatederrorThe conditional expression <condText> could not be evaluated.
M4096dimensions-must-be-parametererrorDimensions must be parameter or constant expression (in <callStr>).
M4097called-function-partialerrorCalled function '<fnName>' is partial.
M4098class-specialization-violationerrorClass specialization violation: <className> <errorDetail>.
M4099cannot-connect-undeclared-expandable-connectorserrorCannot connect undeclared connectors <c1> with <c2>. At least one of them must be declared.
M4101top-level-outer-elementerrorThe model can't be instantiated due to top-level outer element '<elementName>', it may only be used as part of a simulation model.
M4102inner-not-found-existing-declerrorAn inner declaration for outer element '<elementName>' could not be found, and could not be automatically generated due to an existing declaration of that name.
M4103missing-redeclare-keyworderrorMissing redeclare keyword on attempted redeclaration of class <className>.
M4104invalid-redeclaration-class-as-componenterrorInvalid redeclaration of class <className> as component.
M4105duplicate-redeclareerror<name> is already redeclared in this scope.
M4106invalid-redeclaration-prefixerrorInvalid redeclaration '<newPrefix> <name>', original element is declared '<origPrefix>'.
M4107invalid-redeclaration-component-as-classerrorInvalid redeclaration of component <compName> as class.
M4108redeclare-enum-not-subtype-genericerrorRedeclaration of enumeration '<name>' is not a subtype of the redeclared element (use enumeration(:) for a generic replaceable enumeration).
M4109redeclare-enum-not-subtypeerrorRedeclaration of enumeration '<name>' is not a subtype of the redeclared element.
M4110invalid-type-prefix-conflicterrorInvalid type prefix '<newPrefix>' on component <compName>, due to existing type prefix '<existingPrefix>'.
M4111invalid-redeclaration-basic-type-attributeerrorInvalid redeclaration of <attrName>, attributes of basic types may not be redeclared.
M4112extends-other-base-classerrorFound other base class for extends <baseName> after instantiating extends.
M4113external-object-missing-destructorerrorExternal object <className> is missing a destructor.
M4114invalid-connector-variabilityerrorInvalid variability <variability> on connector '<compName>'.
M4115external-object-not-replaceableerror'<elemName>' may not be replaceable.
M4116operator-encapsulationerrorOperator <recordName>.'<opName>' is not encapsulated.
M4117operator-constructor-outputserrorOperator <recordName>.'constructor' must have exactly one output.
M4118operator-constructor-output-typeerrorOutput '<outputName>' in operator <recordName>.'constructor' must be of type <recordName>, got type <actualType>.
M4119variable-in-package-not-constanterrorVariable <varName> in package <pkgName> is not constant.
M4120ambiguous-operator-overloaderrorAmbiguous matching overloaded operator functions found for <exprText>. Candidates are: <candidatesText>
M4121no-matching-operator-functionerrorNo matching function found for <callExprText>. Candidates are: <candidatesText>
M4122cannot-resolve-operator-typeerrorCannot resolve type of expression <exprText>. The operands have types <leftType>, <rightType> in component <NO_COMPONENT>.
M5001equation-type-mismatcherrorType mismatch in equation <lhsExpanded>=<rhsExpanded> of type <lhsType>=<rhsType>.
M5001equationtypemismatcherrorType mismatch in equation <eqText2> of type <lName>=<rName>.
M5002constrainedby-type-mismatcherrorReplaceable '<componentName>': default type '<defaultType>' is not compatible with constraining type '<constrainingType>'.
M5003if-branch-type-mismatcherrorIf-equation branch type mismatch: '<varName>' assigned type '<branchType>' but expected '<expectedType>'.
M5004connect-flow-mismatcherrorCannot connect flow component <flowComp> to non-flow component <nonFlowComp>.
M5004connectflowmismatcherrorCannot connect flow component <flowRef>.<elemIdent> to non-flow component <nonFlowRef>.<elemIdent>.
M5005division-by-zeroerrorDivision by zero: <lhs> / 0.
M5005divisionbyzeroerrorDivision by literal zero in '<target>'.
M5006assignment-type-mismatcherrorType mismatch in assignment in <target> := <source> of <targetType> := <sourceType>
M5006assignmenttypemismatcherrorType mismatch in assignment in <target> of <tName> := <vName>
M5007for-iterator-not-1derrorIterator <iteratorName>, has type <shape>, but expected a 1D array expression.
M5007foriteratornot1derrorIterator iterator, has type Real, but expected a 1D array expression.
M5008assignment-to-constanterrorTrying to assign to constant component in <componentName> := <exprText>
M5008assignmenttoconstanterrorTrying to assign to constant component <idNode>.
M5009assignment-to-inputerrorTrying to assign to input component '<componentName>'.
M5009assignmenttoinputerrorTrying to assign to input component <idNode>.
M5010homotopy-recommendedinfoEquation contains steep nonlinearity '<term>' without homotopy. Consider wrapping with homotopy(actual, simplified).
M5011assignment-to-parametererrorTrying to assign to parameter component in <componentName> := <exprText>
M5012assignment-to-iteratorerrorAssignment to iterator '<iteratorName>'.
M5013not-a-stream-variableerrorOperand '<operand>' to operator '<operator>' is not a stream variable.
M5013notastreamvariableerrorOperand '<aText>' to operator '<fText>' is not a stream variable.
M5014assignment-to-non-variableerrorComponent '<componentName>' may not be assigned to due to class specialization '<specialization>'.
M5015function-call-contains-subscriptserrorFunction call <cref> contains subscripts.
M5016tuple-subscript-not-allowederrorTuple expression can not be subscripted.
M5017when-illegal-contexterrorA when-statement may not be used inside a function or a while, if, or for-clause.
M5017whenillegalcontexterrorA when-statement may not be used inside a function or a while, if, or for-clause.
M5018reduction-invalid-expr-typeerrorInvalid expression '<exprText>' of type <actualType> in <op> reduction, expected <expectedText>.
M5019failed-to-deduce-dimensionerrorFailed to deduce dimension <dimIdx> of <varName> due to missing binding equation.
M5020output-not-definitely-assignederrorOutput variable '<varName>' in function '<funcName>' is not definitely assigned on all control flow paths.
M5021uninitialized-variable-readwarningVariable '<varName>' is read before being definitely assigned.
M5022unreachable-statementwarningUnreachable statement detected.
M5023elsewhen-variable-mismatcherrorThe same variables must be solved in elsewhen clause as in the when clause.
M5023elsewhenvariablemismatcherrorThe same variables must be solved in elsewhen clause as in the when clause.
M5024reinit-type-mismatcherrorThe first argument to reinit must be a subtype of Real, but <varName> has type <actualType>.
M5025implicit-iterator-subscript-missingerrorIdentifier <iterName> of implicit for iterator must be present as array subscript in the loop body.
M5026implicit-iteration-dim-mismatcherrorDimension <dim1> of <name1> and <dim2> of <name2> differs when trying to deduce implicit iteration range.
M5027when-condition-not-discreteerrorWhen-condition '<condText>' is not a discrete-time expression.
M5028when-if-branch-lhs-mismatcherrorThe branches of an if-equation inside a when-equation must have the same set of component references on the left-hand side.
M5029clocked-when-has-elsewhenerrorClocked when equation can not contain elsewhen part.
M5030clocked-when-branch-in-whenerrorClocked when branch in when equation.
M5031invalid-when-lhserrorInvalid left-hand side of when-equation: <lhsStr>.
M5032when-conditional-expected-booleanerrorType error in when conditional '<condStr>'. Expected Boolean scalar or vector, got Clock.
M5033reinit-not-continuouserrorThe first argument to reinit must be a continuous time variable, but <varName> is <variability>.
M5034eval-external-builtinerrorInternal error NFCeval.evalBuiltinCall: unimplemented case for <funcName>
M5035argument-not-differentiableerrorArgument '<argName>' of der is not differentiable.
M5036invalid-size-indexerrorInvalid index <dim> in call to size of <arrName>, valid index interval is [1,<maxDim>].
M5037function-no-named-parametererrorFunction <funcName> has no input parameter named <paramName>.
M5038when-in-initial-equationerrorwhen-clause is not allowed in initial section.
M5039size-first-arg-not-arrayerrorThe first argument of size(<argText>) must be an array expression.
M5040reinit-outside-whenerrorOperator reinit may only be used in the body of a when equation.
M5041reinit-in-algorithmerrorOperator reinit may not be used in an algorithm section (use translation flag --allowNonStandardModelica=reinitInAlgorithms to ignore).
M5042reinit-arg1-not-variableerrorThe first argument to reinit must be a variable of type Real or an array of such variables.
M5043illegal-end-usageerror'end' can not be used outside array subscripts.
M5044reinit-arg2-type-mismatcherrorType mismatch for positional argument 2 in reinit(=<argText>). The argument has type: <actualType> expected type: <expectedType>
M6001mixed-clock-domainserrorClocked expression '<exprText>' mixes signals from different clock domains.
M6001mixedclockdomainserrorMixed clock domains in expression '<target>' without explicit conversion operator.
M6002sample-factor-not-positiveerrorSub-clock factor must be a positive integer.
M6002samplefactornotpositiveerrorSample factor '<target>' must be a positive non-zero integer.
M6003previous-outside-clockederrorOperator 'previous()' may only be applied to clocked discrete-time variables in '<exprText>'.
M6003previousoutsideclockederrorprevious() can only be called on clocked discrete variables, but '<target>' is unclocked.
M6004hold-in-continuouserrorOperator 'hold()' converts a clocked signal to continuous-time and cannot be used inside a clocked partition: '<exprText>'.
M6004holdincontinuouserrorhold() operator cannot be called in continuous equation section without boundary causality.
M6010duplicate-initial-stateerrorA state machine partition must have at most one initialState() call.
M6010duplicateinitialstateerrorMore than one state marked as initialState in state machine '<target>'.
M6020impure-called-in-pureerrorImpure function '<callText>' cannot be called inside a pure function.
M6020impurecalledinpureerrorPure function cannot call impure function '<target>'.
M6021impure-in-equation-sectionerrorImpure function '<callText>' may only be called inside a when-equation or when-statement.
M6021impureinequationsectionerrorImpure function '<target>' may only be called in algorithm sections or when equations.
M6040break-connection-not-founderrorConnection '<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 ToolDescription
modelica_loadLoads .mo files or Modelica Standard Library packages into the persistent workspace session
modelica_parseParses Modelica source code with the WASM GLR parser and returns CST nodes and syntax diagnostics
modelica_flattenFlattens a Modelica class via ModelicaFlattener and returns the flat Modelica DAE representation
modelica_lintRuns all 307 semantic and structural lint rules on a Modelica file or package
modelica_simulateFlattens, runs BLT/index reduction, integrates the DAE over [t0,tstop], and returns trajectory time-series
hybrid_simulateExecutes a hybrid continuous Modelica DAE + discrete-event DEVS simulation
modelica_doeExecutes a multi-parameter Design of Experiments (Full Factorial / Latin Hypercube) batch sweep
modelica_sensitivityComputes local finite-difference or forward sensitivity matrices ∂yi/∂pj for target outputs
modelica_queryQueries the Salsa QueryEngine for class components, resolved types, variabilities, and modifications
modelica_diff_calibrateCalibrates Modelica parameters against target CSV trajectory data via L-BFGS / Adam gradient optimization

SysML v2 Transformer & Polyglot TGG Rules ​

  • Direct AST Transformer (modelicaToSysML2 in languages/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

Diagnostic Rules ​

307 rules281 error12 info2 notification12 warning Run with msx lint

CodeRuleSeverityMessage
M1000identity-arg-counterrorWrong number of arguments to identity.
M1001parse-errorerrorParse error.
M1002parse-missingerrorParse error: '<expected>' expected.
M1003empty-array-constructorerrorParse error: Empty array constructors are not valid in Modelica.
M1003emptyarrayconstructorerrorEmpty array constructor '<target>' is not valid in Modelica.
M1004identity-first-arg-integererrorFirst argument to identity in component <compName> must be Integer expression.
M1005subscripted-modifiererrorSubscripting modifiers is not allowed. Apply the modification on the whole identifier using an array-expression or an each-modifier.
M1099wasm-flattener-unsupportederror[ModelicaFlattener] Model '<rootName>' could not be flattened using strict WASM backend.
M2001duplicate-elementerrorAn element with name <name> is already declared in this scope.
M2002variable-not-founderrorVariable <name> not found in scope <scope>.
M2002variablenotfounderrorVariable <vName> not found in scope <className>.
M2003class-not-founderrorClass <className> not found in scope <scope> (looking for a function or record).
M2003typenotfounderrorClass or type '<fullType>' not found in scope.
M2004modifier-not-founderrorIn modifier of '<componentName>', class or component '<modName>' not found in '<className>'.
M2005identifier-mismatcherrorThe identifier at start and end are different.
M2005identifiermismatcherrorParse error: The identifier at start and end are different
M2006modified-element-not-founderrorModified element <modName> not found in class <className>.
M2007modifier-class-not-founderrorIn modifier (<modText>), class or component <modName> not found in <<className>>.
M2011same-name-type-shadowingerrorFound a component with same name when looking for type <typeSpec>.
M2012class-not-found-in-scopeerrorClass <className> not found in scope <scope>.
M2013base-class-not-found-in-scopeerrorBase class <className> not found in scope <scope>.
M2014partial-base-classerrorPart <partName> of base class name <extName> is not a class.
M2015base-class-ambiguouserrorThe base class name <partName> was found in one or more base classes: <candidateNames>.
M2016base-class-found-inerror<partName> was found in base class <baseName>.
M2038partial-lookup-disallowederror<className> is partial, name lookup is not allowed in partial classes.
M2090finaloverridenotificationinfoFrom here:
M2090from-herenotificationFrom here:
M2091redeclare-final-component-notificationinfoFrom here:
M2091redeclarefinalcomponentnotificationinfoFrom here:
M2092redeclare-constant-component-notificationinfoFrom here:
M2092redeclareconstantcomponentnotificationinfoFrom here:
M2093duplicate-modification-notificationinfoFrom here:
M2093duplicatemodificationnotificationinfoFrom here:
M2094missing-innerwarningNo 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.
M2094missinginnerwarningNo corresponding 'inner' declaration found in scope for outer component '<target>'.
M2095from-here-tracenotificationFrom here:
M2096redeclare-non-replaceable-notificationinfoFrom here:
M2096redeclarenonreplaceablenotificationinfoFrom here:
M2097protected-modification-notificationinfoFrom here:
M2097protectedmodificationnotificationinfoFrom here:
M3001type-mismatch-bindingerrorType mismatch in binding <componentName> = <actualExpr>, expected subtype of <expectedType>, got type <actualType>.
M3001typemismatchbindingerrorType mismatch in binding <target>, expected subtype of <expName>, got type <actName>.
M3002type-mismatch-modifiererrorType mismatch: '<modName>' expects type '<expectedType>' but got '<actualType>'.
M3002typemismatchmodificationerrorType mismatch in binding or modification expression '<target>'.
M3003not-plug-compatibleerrorThe connectors in connect(<ref1>, <ref2>) are not type compatible.
M3004not-a-connectorerror<which> is not a valid connector.
M3005redeclare-type-mismatcherrorRedeclare of '<redeclaredName>': type '<newType>' is not compatible with constraining type '<constrainingType>'.
M3006function-arg-type-mismatcherrorType mismatch for positional argument <argPosition> in <callExpr>. The argument has type: <argTypeSignature> expected type: <expectedTypeSignature>
M3007connect-invalid-formerror<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).
M3008extends-type-mismatcherrorIn extends of '<className>': redeclared '<redeclaredName>' of type '<newType>' is not compatible with original type '<originalType>'.
M3009array-index-type-mismatcherrorArray index type mismatch: expected Integer or Boolean, but got '<actualType>'.
M3009arrayindextypemismatcherrorArray index '<target>' has invalid type: expected Integer or Boolean.
M3010unit-mismatchwarningUnit mismatch: Left-hand side has unit '<lhsUnit>' but right-hand side has incompatible unit '<rhsUnit>'.
M3010unitmismatchbindingwarningUnit mismatch in equation '<target>'.
M3010unitmismatchequationwarningUnit mismatch in equation '<target>'.
M3011binary-op-type-mismatcherrorCannot resolve type of expression <expr>. The operands have types <type1>, <type2> in component <NO_COMPONENT>.
M3012optimization-objective-typeerrorOptimization objective must be a scalar Real, but got type '<typeStr>'.
M3013optimization-constraint-typeerrorOptimization constraints must evaluate to scalar Real or Boolean expressions, but got type '<typeStr>'.
M3014builtin-attribute-type-mismatcherrorType mismatch in binding <attrName> = <bindingText>, expected subtype of <expectedType>, got type <actualType>.
M3015attribute-type-mismatcherrorVariable <varName>: Wrong type on builtin attribute <attrName> (type was: <actualType>, expected: <expectedType>).
M3016conditional-type-mismatcherrorType error in conditional '<condExpr>'. Expected Boolean, got <actualType>.
M3017connect-types-inconsistenterrorThe type of variables <r0Raw> type: <type0> and <r1Raw> type: <type1> are inconsistent in connect equations.
M3018array-element-type-mismatcherrorArray constructor elements have inconsistent types in '<exprText>'.
M3018arrayelementtypemismatcherrorArray element type mismatch in '<target>'.
M3019no-matching-functionerrorNo matching function found for <callExpr> of type <callSig> candidates are <candidateSig>
M3020type-mismatch-modifier-bindingerrorType mismatch in modifier of component <compName>, expected type <expectedType>, got modifier <exprText> of type <actualType>.
M3021function-return-type-mismatcherrorFunction '<funcName>' returns type '<actualType>' but '<expectedType>' expected.
M4000dimension-not-parametererrorExpression '<exprName>' that determines the size of dimension '<dim>' of '<callText>' is not an evaluable parameter expression.
M4001extends-cycleerrorextends <baseName> causes an instantiation loop.
M4001extendscycleerrorExtends cycle detected for '<target>'.
M4002duplicate-modificationerrorDuplicate modification of element <elementName> on <kind> <componentName>.
M4002duplicatemodificationerror<outerName>.<innerOrKind>
M4003array-dimension-mismatcherrorType mismatch in binding '<componentName> = <exprText>', expected array dimensions [<expectedShape>], got [<actualShape>].
M4003arrayshapemismatcherrorArray shape mismatch: declared dimension does not match initializer element count in '<target>'.
M4004unbalanced-modelwarningThe <classKind> '<name>' is not balanced: <nEquations> equation(s) and <nVariables> variable(s).
M4004unbalancedmodelwarningModel '<target>' is not balanced: <value> equations for <value> variables.
M4005protected-modificationerrorProtected element '<elementName>' may not be modified, got '<modText>'.
M4005protectedmodificationerrorProtected element '<eName>' may not be modified, got '<mText>'.
M4006external-with-algorithmerrorElement is not allowed in function context: algorithm
M4006externalwithalgorithmerrorElement '<target>' is not allowed in function context with algorithm section.
M4007function-public-variableerrorInvalid public variable <varName>, function variables that are not input/output must be protected.
M4007functionpublicvariableerrorInvalid public variable <varName>, function variables that are not input/output must be protected.
M4008array-subscript-count-mismatcherrorWrong number of subscripts in <refStr> (<actualCount> subscripts for <expectedCount> dimensions).
M4009function-default-arg-cycleerrorThe default value of <paramName> causes a cyclic dependency.
M4010function-invalid-var-typeerrorInvalid type <typeName> for function component <varName>.
M4011function-protected-ioerrorInvalid protected variable <varName>, function variables that are input/output must be public.
M4011functionprotectedioerrorInvalid protected variable <varName>, function variables that are input/output must be public.
M4012function-arg-variabilityerrorFunction argument <paramName>=<argExpr> in call to <funcName> has variability <actualVariability> which is not a <requiredVariability> expression.
M4013nested-when-statementerrorNested when statements are not allowed.
M4013nestedwhenerrorNested when statements are not allowed.
M4014tuple-expression-contexterrorTuple 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>.
M4014tupleexpressioncontexterrorTuple expressions may only occur on the left side of an assignment or equation with a single function call on the right side.
M4015within-in-scripterrorThe within directive is not allowed in script mode.
M4016statement-in-standard-modeerrorTop-level statements are not allowed in standard Modelica mode.
M4017restriction-violationerror<what> are not allowed in <classKind>.
M4017restrictionviolationerrorAlgorithm sections are not allowed in <kindStr>.
M4018partial-instantiationerrorIllegal to instantiate partial class <className>.
M4019redeclare-non-replaceableerrorRedeclaration with a new type requires '<elementName>' to be replaceable.
M4019redeclarenonreplaceableerrorRedeclaration with a new type requires '<eName>' to be replaceable.
M4020builtin-time-invaliderrortime is not allowed in a function.
M4020reservedbuiltintimeerrorIdentifier time is reserved for the built-in element with the same name.
M4020timeinfunctionerrortime is not allowed in a function.
M4021range-step-too-smallerrorStep size <stepSize> in range is too small.
M4022enum-range-with-steperrorRange of type enumeration <enumType> may not specify a step size.
M4022enumrangewithsteperrorRange of type enumeration '<target>' may not specify a step size.
M4023connect-in-whenerrorconnect may not be used inside when-equations (found <connectExpr>).
M4023connectinwhenerrorconnect may not be used inside when-equations (found <target>).
M4024connect-in-initialerrorConnect equations are not allowed in initial equation sections.
M4024connectininitialerrorConnect equations are not allowed in initial equation sections.
M4025connect-in-non-param-iferrorconnect may not be used inside if-equations with non-parametric conditions (found <connectExpr>).
M4025connectinnonparamiferrorconnect may not be used inside if-equations with non-parametric conditions (found <target>).
M4026final-overrideerrorTrying to override final element <elementName> with modifier '<modText>'.
M4026finaloverrideerrorTrying to override final element <eName> with modifier '<mText>'.
M4027variability-binding-mismatcherrorComponent <componentName> of variability <compVariability> has binding '<bindingExpr>' of higher variability <bindingVariability>.
M4027variabilitybindingmismatcherrorComponent <compName> of variability parameter has binding '<target>' of higher variability continuous.
M4028partial-type-componenterrorComponent '<componentName>' has partial type '<typeName>'.
M4028partialtypecomponenterrorComponent '<target>' has partial type.
M4029component-binding-restrictionerrorComponent '<componentName>' may not have a binding equation due to class specialization '<classKind>'.
M4030outer-modifiererrorModifier '<modText>' found on outer element <elementName>.
M4030outermodifiererrorModifier '<modNode>' found on outer element <nameNode>.
M4031array-index-out-of-boundserrorSubscript '<index>' for dimension <dimensionIndex> (size = <dimensionSize>) of <arrayName> is out of bounds.
M4031arrayindexoutofboundserrorSubscript 'index' for dimension <dimIndex> (size = <dimSize>) of array is out of bounds.
M4032function-invalid-prefixerrorInvalid prefix <prefix> on formal parameter <varName>.
M4032functioninvalidprefixerrorInvalid prefix '<target>' on formal parameter in function.
M4033function-multiple-algorithmerrorFunction <funcName> has more than one algorithm section or external declaration.
M4033functionmultiplealgorithmerrorFunction <name> has more than one algorithm section or external declaration.
M4034replaceable-base-classerrorClass '<className>' in 'extends <extendsText>' is replaceable, the base class name must be transitively non-replaceable.
M4034replaceablebaseclasserrorClass '<target>' in 'extends <target>' is replaceable, the base class name must be transitively non-replaceable.
M4035cyclic-dimension-dependencyerrorDimension <dimNum> of <varName>, '<exprText>', could not be evaluated due to a cyclic dependency.
M4036package-variable-not-constanterrorVariable <varName> in package <packageName> is not constant.
M4037connector-variabilityerrorInvalid variability <variability> on connector '<connectorName>'.
M4037connectorvariabilityerrorInvalid variability <pfx> on connector '<compName>'.
M4038flow-outside-connectorwarningPrefix 'flow' used outside connector declaration.
M4038flowoutsideconnectorwarningPrefix '<target>' used outside connector declaration.
M4039discrete-not-on-lhserrorFollowing variable is discrete, but does not appear on the LHS of a when-statement: '<varName>'.
M4039discretenotonlhserrorFollowing variable is discrete, but does not appear on the LHS of a when-statement: '<target>'.
M4040protected-element-modificationerrorProtected element '<varName>' may not be modified, got '<modText>'.
M4041negative-dimensionerrorNegative dimension index (<dim>) for component <varName>.
M4041negativedimensionerrorNegative dimension index (-1) for component component.
M4042constant-has-no-valueerrorConstant '<qualifiedName>' has no value.
M4042constanthasnovalueerrorConstant '<target>' has no value.
M4043constant-variability-violationerrorComponent <componentName> of variability constant has binding '<bindingText>' of higher variability <bindingVariability>.
M4043constantvariabilityviolationerrorComponent <compName> of variability constant has binding '<target>' of higher variability <varbNode>.
M4044non-array-modificationerrorNon-array modification '<modText>' for array component '<componentName>', possibly due to missing 'each'.
M4044nonarraymodificationerrorNon-array modification '<fullMod>' for array component, possibly due to missing 'each'.
M4045modified-element-not-found-csterrorModified element <modName> not found in class <className>.
M4045modifiedelementnotfounderrorModified element <eText> not found in class <tText>.
M4046constant-not-fixederrorConstant '<componentName>' must be fixed but has 'fixed = false'
M4046constantnotfixederrorConstant declaration '<target>' must be fixed.
M4047cardinality-invalid-contexterrorcardinality may only be used in the condition of an if-statement/equation or an assert.
M4047cardinalityinvalidcontexterrorOperator '<target>' may only be used in the condition of an if-statement/equation or an assert.
M4048cardinality-expected-componenterrorExpected <name> to be a component, but found class instead.
M4048cardinalityexpectedcomponenterrorExpected <target> to be a component, but found class instead.
M4049break-on-non-componenterrorInvalid use of break on non-component '<name>'.
M4049breakonnoncomponenterrorInvalid use of break on non-component '<ident>'.
M4050break-component-invalid-typeerrorInvalid use of break on component '<name>', component must be a model, block, or connector.
M4050breakcomponentinvalidtypeerrorInvalid use of break on component '<ident>', component must be a model, block, or connector.
M4051break-connect-not-founderrorNo matching element found for '<connText>'.
M4051breakconnectnotfounderrorNo matching element found for '<target>'.
M4052redeclare-final-componenterrorRedeclaration of final component <name> is not allowed.
M4052redeclarefinalcomponenterrorRedeclaration of final component <eName> is not allowed.
M4053redeclare-constant-componenterrorRedeclaration of constant component <name> is not allowed.
M4053redeclareconstantcomponenterrorRedeclaration of constant component <eName> is not allowed.
M4054stream-unbalanced-connectorerrorInvalid stream connector <connectorName>: A stream connector must have exactly one flow variable, this connector has <flowCount> flow variables.
M4054streamunbalancedconnectorerrorInvalid stream connector .<cName>: A stream connector must have exactly one flow variable, this connector has <fCount> flow variables.
M4055cannot-connect-expandable-with-non-expandableerrorCannot connect expandable connector <expName> with non-expandable connector <nonExpName>.
M4055cannotconnectexpandablewithnonexpandableerrorCannot connect expandable connector <expRef> with non-expandable connector <nonExpRef>.
M4056duplicate-inherited-element-not-identicalerrorDuplicate elements (due to inherited elements) not identical: first element is: <currText> second element is: <prevText>
M4057expandable-connector-flow-elementerrorPrefix 'flow' on component '<compName>' not allowed in class specialization 'expandable connector'.
M4057expandableconnectorflowelementerrorPrefix 'flow' on component '<compName>' not allowed in class specialization 'expandable connector'.
M4058recursive-definitionerrorDeclaration of element <elemName> causes recursive definition of class <className>.
M4059max-recursion-depth-exceedederrorThe maximum recursion depth of <depth> was reached, probably due to mutually recursive definitions.
M4061redeclare-non-inheritederrorIllegal redeclare of element <elementName>, no inherited element with that name exists.
M4061redeclarenoninheritederrorIllegal redeclare of element <eName>, no inherited element with that name exists.
M4062invalid-external-objecterrorExternal object <className> contains invalid element '<elemName>'.
M4063class-extends-non-inheritederrorBase class targeted by class extends <className> not found in the inherited classes.
M4063classextendsnoninheritederrorInvalid redeclaration of class <eName>, class extends only allowed on inherited classes.
M4064protected-in-connectorerrorProtected sections are not allowed in connector.
M4064protectedinconnectorerrorProtected sections are not allowed in <kindStr>.
M4065equationinconnectorerrorEquations are not allowed in connector.
M4065equations-in-connectorerrorEquations are not allowed in connector.
M4066algorithm-in-connectorerrorAlgorithm sections are not allowed in connector.
M4066algorithminconnectorerrorAlgorithm sections are not allowed in connector.
M4067external-object-missing-constructorerrorExternal object <className> is missing a constructor.
M4068redeclare-condition-attributeerrorInvalid redeclaration of <elementName>, a redeclare may not have a condition attribute.
M4068redeclareconditionattributeerrorInvalid redeclaration of <eName>, a redeclare may not have a condition attribute.
M4069external-object-return-restrictionerrorFunction <fnName> returns an external object, but the only function allowed to return this object is <extObjName>.constructor.
M4070external-non-functionerrorClass specialization violation: <className> is a <specialization>, which may not contain an external declaration.
M4070externalnonfunctionerrorClass specialization violation: <name> is a <kindStr>, which may not contain an external declaration.
M4071external-invalid-languageerror'<lang>' is not a valid language for an external function.
M4072external-invalid-arg-exprerrorExpression <expr> cannot be an external argument. Only identifiers, scalar constants, and size-expressions are allowed.
M4073external-invalid-arg-size-consterrorInvalid external argument '<expr>', the dimension index must be a constant expression.
M4074external-array-return-not-allowederrorThe 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).
M4075invalid-type-prefix-flow-nestederrorInvalid type prefix 'flow' on variable <varName>, due to existing type prefix 'flow'.
M4076parameter-bound-contradictionerrorContradictory bounds for parameter '<paramName>': lower bound '<lower>' exceeds upper bound '<upper>'.
M4076parameterboundcontradictionerrorContradictory bounds for parameter 'parameter': lower bound 'min' exceeds upper bound 'max'.
M4077loop-termination-inconclusiveerrorLoop over '<loopVar>' with condition '<condition>' cannot be proven to terminate.
M4078terminate-in-functionerrorterminate is not allowed in a function.
M4078terminateinfunctionerrorterminate is not allowed in a function.
M4079return-outside-functionerror'return' may not be used outside function.
M4079returnoutsidefunctionerror'return' may not be used outside function.
M4080cyclic-constants-or-parameterserrorCyclically dependent constants or parameters found in scope <scopeName>: {<cycleList>} (ignore with -d=ignoreCycles).
M4081cyclic-function-componentserrorCyclically dependent function components found: {<cycleList>}
M4082connector-non-parameter-subscripterrorConnector '<connRef>' has non-parameter subscript '<subscriptText>'.
M4083enum-duplicate-literalerrorEnumeration has duplicate names: <dup> in list of names <list>.
M4084enum-reserved-attribute-literalerrorInvalid use of reserved attribute name <name> as enumeration literal.
M4091break-outside-looperror'break' must be inside a for or while loop, or enclose a connect equation.
M4091breakoutsidelooperror'break' may only be used in a while- or for-loop.
M4092binding-dimension-mismatcherrorType mismatch in binding '<componentName> = <bindingText>', expected array dimensions [<expectedDims>], got [<actualDims>].
M4093unused-input-variablewarningUnused input variable <varName> in function <funcName>.
M4094cardinality-in-condition-onlyerrorcardinality may only be used in the condition of an if-statement or if-equation.
M4095conditional-expression-not-evaluatederrorThe conditional expression <condText> could not be evaluated.
M4096dimensions-must-be-parametererrorDimensions must be parameter or constant expression (in <callStr>).
M4097called-function-partialerrorCalled function '<fnName>' is partial.
M4098class-specialization-violationerrorClass specialization violation: <className> <errorDetail>.
M4099cannot-connect-undeclared-expandable-connectorserrorCannot connect undeclared connectors <c1> with <c2>. At least one of them must be declared.
M4101top-level-outer-elementerrorThe model can't be instantiated due to top-level outer element '<elementName>', it may only be used as part of a simulation model.
M4102inner-not-found-existing-declerrorAn inner declaration for outer element '<elementName>' could not be found, and could not be automatically generated due to an existing declaration of that name.
M4103missing-redeclare-keyworderrorMissing redeclare keyword on attempted redeclaration of class <className>.
M4104invalid-redeclaration-class-as-componenterrorInvalid redeclaration of class <className> as component.
M4105duplicate-redeclareerror<name> is already redeclared in this scope.
M4106invalid-redeclaration-prefixerrorInvalid redeclaration '<newPrefix> <name>', original element is declared '<origPrefix>'.
M4107invalid-redeclaration-component-as-classerrorInvalid redeclaration of component <compName> as class.
M4108redeclare-enum-not-subtype-genericerrorRedeclaration of enumeration '<name>' is not a subtype of the redeclared element (use enumeration(:) for a generic replaceable enumeration).
M4109redeclare-enum-not-subtypeerrorRedeclaration of enumeration '<name>' is not a subtype of the redeclared element.
M4110invalid-type-prefix-conflicterrorInvalid type prefix '<newPrefix>' on component <compName>, due to existing type prefix '<existingPrefix>'.
M4111invalid-redeclaration-basic-type-attributeerrorInvalid redeclaration of <attrName>, attributes of basic types may not be redeclared.
M4112extends-other-base-classerrorFound other base class for extends <baseName> after instantiating extends.
M4113external-object-missing-destructorerrorExternal object <className> is missing a destructor.
M4114invalid-connector-variabilityerrorInvalid variability <variability> on connector '<compName>'.
M4115external-object-not-replaceableerror'<elemName>' may not be replaceable.
M4116operator-encapsulationerrorOperator <recordName>.'<opName>' is not encapsulated.
M4117operator-constructor-outputserrorOperator <recordName>.'constructor' must have exactly one output.
M4118operator-constructor-output-typeerrorOutput '<outputName>' in operator <recordName>.'constructor' must be of type <recordName>, got type <actualType>.
M4119variable-in-package-not-constanterrorVariable <varName> in package <pkgName> is not constant.
M4120ambiguous-operator-overloaderrorAmbiguous matching overloaded operator functions found for <exprText>. Candidates are: <candidatesText>
M4121no-matching-operator-functionerrorNo matching function found for <callExprText>. Candidates are: <candidatesText>
M4122cannot-resolve-operator-typeerrorCannot resolve type of expression <exprText>. The operands have types <leftType>, <rightType> in component <NO_COMPONENT>.
M5001equation-type-mismatcherrorType mismatch in equation <lhsExpanded>=<rhsExpanded> of type <lhsType>=<rhsType>.
M5001equationtypemismatcherrorType mismatch in equation <eqText2> of type <lName>=<rName>.
M5002constrainedby-type-mismatcherrorReplaceable '<componentName>': default type '<defaultType>' is not compatible with constraining type '<constrainingType>'.
M5003if-branch-type-mismatcherrorIf-equation branch type mismatch: '<varName>' assigned type '<branchType>' but expected '<expectedType>'.
M5004connect-flow-mismatcherrorCannot connect flow component <flowComp> to non-flow component <nonFlowComp>.
M5004connectflowmismatcherrorCannot connect flow component <flowRef>.<elemIdent> to non-flow component <nonFlowRef>.<elemIdent>.
M5005division-by-zeroerrorDivision by zero: <lhs> / 0.
M5005divisionbyzeroerrorDivision by literal zero in '<target>'.
M5006assignment-type-mismatcherrorType mismatch in assignment in <target> := <source> of <targetType> := <sourceType>
M5006assignmenttypemismatcherrorType mismatch in assignment in <target> of <tName> := <vName>
M5007for-iterator-not-1derrorIterator <iteratorName>, has type <shape>, but expected a 1D array expression.
M5007foriteratornot1derrorIterator iterator, has type Real, but expected a 1D array expression.
M5008assignment-to-constanterrorTrying to assign to constant component in <componentName> := <exprText>
M5008assignmenttoconstanterrorTrying to assign to constant component <idNode>.
M5009assignment-to-inputerrorTrying to assign to input component '<componentName>'.
M5009assignmenttoinputerrorTrying to assign to input component <idNode>.
M5010homotopy-recommendedinfoEquation contains steep nonlinearity '<term>' without homotopy. Consider wrapping with homotopy(actual, simplified).
M5011assignment-to-parametererrorTrying to assign to parameter component in <componentName> := <exprText>
M5012assignment-to-iteratorerrorAssignment to iterator '<iteratorName>'.
M5013not-a-stream-variableerrorOperand '<operand>' to operator '<operator>' is not a stream variable.
M5013notastreamvariableerrorOperand '<aText>' to operator '<fText>' is not a stream variable.
M5014assignment-to-non-variableerrorComponent '<componentName>' may not be assigned to due to class specialization '<specialization>'.
M5015function-call-contains-subscriptserrorFunction call <cref> contains subscripts.
M5016tuple-subscript-not-allowederrorTuple expression can not be subscripted.
M5017when-illegal-contexterrorA when-statement may not be used inside a function or a while, if, or for-clause.
M5017whenillegalcontexterrorA when-statement may not be used inside a function or a while, if, or for-clause.
M5018reduction-invalid-expr-typeerrorInvalid expression '<exprText>' of type <actualType> in <op> reduction, expected <expectedText>.
M5019failed-to-deduce-dimensionerrorFailed to deduce dimension <dimIdx> of <varName> due to missing binding equation.
M5020output-not-definitely-assignederrorOutput variable '<varName>' in function '<funcName>' is not definitely assigned on all control flow paths.
M5021uninitialized-variable-readwarningVariable '<varName>' is read before being definitely assigned.
M5022unreachable-statementwarningUnreachable statement detected.
M5023elsewhen-variable-mismatcherrorThe same variables must be solved in elsewhen clause as in the when clause.
M5023elsewhenvariablemismatcherrorThe same variables must be solved in elsewhen clause as in the when clause.
M5024reinit-type-mismatcherrorThe first argument to reinit must be a subtype of Real, but <varName> has type <actualType>.
M5025implicit-iterator-subscript-missingerrorIdentifier <iterName> of implicit for iterator must be present as array subscript in the loop body.
M5026implicit-iteration-dim-mismatcherrorDimension <dim1> of <name1> and <dim2> of <name2> differs when trying to deduce implicit iteration range.
M5027when-condition-not-discreteerrorWhen-condition '<condText>' is not a discrete-time expression.
M5028when-if-branch-lhs-mismatcherrorThe branches of an if-equation inside a when-equation must have the same set of component references on the left-hand side.
M5029clocked-when-has-elsewhenerrorClocked when equation can not contain elsewhen part.
M5030clocked-when-branch-in-whenerrorClocked when branch in when equation.
M5031invalid-when-lhserrorInvalid left-hand side of when-equation: <lhsStr>.
M5032when-conditional-expected-booleanerrorType error in when conditional '<condStr>'. Expected Boolean scalar or vector, got Clock.
M5033reinit-not-continuouserrorThe first argument to reinit must be a continuous time variable, but <varName> is <variability>.
M5034eval-external-builtinerrorInternal error NFCeval.evalBuiltinCall: unimplemented case for <funcName>
M5035argument-not-differentiableerrorArgument '<argName>' of der is not differentiable.
M5036invalid-size-indexerrorInvalid index <dim> in call to size of <arrName>, valid index interval is [1,<maxDim>].
M5037function-no-named-parametererrorFunction <funcName> has no input parameter named <paramName>.
M5038when-in-initial-equationerrorwhen-clause is not allowed in initial section.
M5039size-first-arg-not-arrayerrorThe first argument of size(<argText>) must be an array expression.
M5040reinit-outside-whenerrorOperator reinit may only be used in the body of a when equation.
M5041reinit-in-algorithmerrorOperator reinit may not be used in an algorithm section (use translation flag --allowNonStandardModelica=reinitInAlgorithms to ignore).
M5042reinit-arg1-not-variableerrorThe first argument to reinit must be a variable of type Real or an array of such variables.
M5043illegal-end-usageerror'end' can not be used outside array subscripts.
M5044reinit-arg2-type-mismatcherrorType mismatch for positional argument 2 in reinit(=<argText>). The argument has type: <actualType> expected type: <expectedType>
M6001mixed-clock-domainserrorClocked expression '<exprText>' mixes signals from different clock domains.
M6001mixedclockdomainserrorMixed clock domains in expression '<target>' without explicit conversion operator.
M6002sample-factor-not-positiveerrorSub-clock factor must be a positive integer.
M6002samplefactornotpositiveerrorSample factor '<target>' must be a positive non-zero integer.
M6003previous-outside-clockederrorOperator 'previous()' may only be applied to clocked discrete-time variables in '<exprText>'.
M6003previousoutsideclockederrorprevious() can only be called on clocked discrete variables, but '<target>' is unclocked.
M6004hold-in-continuouserrorOperator 'hold()' converts a clocked signal to continuous-time and cannot be used inside a clocked partition: '<exprText>'.
M6004holdincontinuouserrorhold() operator cannot be called in continuous equation section without boundary causality.
M6010duplicate-initial-stateerrorA state machine partition must have at most one initialState() call.
M6010duplicateinitialstateerrorMore than one state marked as initialState in state machine '<target>'.
M6020impure-called-in-pureerrorImpure function '<callText>' cannot be called inside a pure function.
M6020impurecalledinpureerrorPure function cannot call impure function '<target>'.
M6021impure-in-equation-sectionerrorImpure function '<callText>' may only be called inside a when-equation or when-statement.
M6021impureinequationsectionerrorImpure function '<target>' may only be called in algorithm sections or when equations.
M6040break-connection-not-founderrorConnection '<connText>' in 'break' modifier does not exist in base class.

Generated from languages/modelica/src/errors.tslanguages/modelica/src/lints/index.ts. All languages →

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Trademark Policy