3. Semantic Errors
The error log displays the text of the line containing the start of the offending construct. The number in brackets is an index in the source file. In most cases, it's the index of the first token in the smallest declaration or statement containing the error. This is not terribly helpful when the error occurs inside a very long expression.
As indicated in the list that follows, many messages begin with a reconstructed version of some Cedar expression (e.g, "k" in the example above). The reconstruction is done by unparsing an intermediate representation. The second and third passes of the compiler try not to lose information and can usually report errors in terms of the original source code, perhaps with some embellishment or canonicalization. Later passes attempt a certain amount of compile-time evaluation and optimization that can lose structure; it's unfortunately not too uncommon for the fourth pass to report an offending value in terms of its internal representation, expressed as a decimal or octal number.
The unparser does not fully expand deeply nested expressions; omitted subexpressions are indicated by "...". There are also a few constructs not currently handled by the unparser; the reconstructed text is either missing or is replaced by "..." in these cases.
3.1. Errors
attempt to access private fields
In a constructor or extractor, even if the fields aren't mentioned and have defaults.
Alternatively, discriminating a variant record with a private tag field or locking a MONITORED record with a private lock field. Note that the lock field is declared implicitly and inherits the default visibility attribute of the record type.
body or catch phrase nested too deeply
Nesting depth exceeds 15, where the depth is 1 at the module level and increases by one for each (non-inline) procedure body or catch phrase.
Note: This error can be triggered by the expansion of an inline procedure containing local procedure declarations or catch phrases.
<id> cannot be defaulted
Omitted keyword in a keyword constructor, but the corresponding field has no default value.
<id> cannot be defaulted or voided
Omitted expression in a positional constructor or argument list, but the field in the corresponding position does not allow a default. The identifier is the field name and is omitted for anonymous fields or array components.
<id> cannot be opened
BCD file containing the included module cannot be opened, usually because it cannot be found in the current working directory. Alternatively, the file was found but does not have the internal passwords used by the compiler for validity checks (file incomplete, damaged, or produced by an older and incompatible version of the compiler).
An included module can reference other modules not explicitly mentioned in the DIRECTORY of the program being compiled. In some circumstances, the compiler must access these implicitly included modules and attempts to open them, possibly failing with this message. These circumstances are not easy to characterize precisely but usually arise because the compiler needs information about the internal structure of an enumeration or record type in the implicitly referenced module.
This error frequently has the unfortunate side effect of producing a cascade of messages about undefined and misused identifiers.
<id> cannot have a specified position
Explicitly specified field positions are used in defining a record type that is not declared to be MACHINE DEPENDENT.
compilation aborted
User-requested abort. Compilation terminates cleanly between phases.
default return of anonymous value
An explicit RETURN or RESUME that defaults the returned values to be the formal result variables, when those variables are unnamed and have undefined values. Alternatively, an implicit RETURN at the end of a procedure with such formal result variables.
Note: The compiler suppresses this message for an implicit RETURN if it can discover that such a RETURN is unreachable. Its flow analysis is incomplete and conservative; sometimes this message appears because the compiler has not recognized that a case analysis is exhaustive (put an ERROR on the ENDCASE to fix this), that a loop cannot terminate normally, etc.
<expr> does not allow an argument list
But is followed by a bracketed list of expressions.
<expr> does not allow indirect reference
Does not designate a variable and cannot be used as the operand of @ or similar operators. Alternatively, designates an unaligned record field or a packed array element, for which the implementation does not support explicit address generation.
<id> does not name a variant
In the naming of a disciminated type, or as a case label in a discriminating SELECT.
<expr> exceeds addressing limits
If the expression is the identifier of a variable, that variable causes the size of a local frame to exceed 212-1 (4095) words. If the expression is a field name, that field causes the size of a record to exceed 212-1 (4095) words. Note that variables and fields are not necessarily allocated in lexical order.
If the expression is a procedure identifier, allocation of compiler generated temporaries for that procedure causes the size of a local frame to exceed 212-1 (4095) words. If the expression is a STRING literal, allocation of space for that string causes the overflow.
<expr> explicit selection not permitted
In a (non-copying) WITH ... SELECT discrimination, an explicit selector is supplied for a variant record that does not have a COMPUTED tag.
FATAL COMPILER ERROR
Internal consistency failure. See section 1.3. Rollback before attempting further compilations.
<id> found in wrong version
When the compiler requires a specific version of a BCD file.
For explicitly included modules, the compiler uses whatever version of the corresponding file is found in the working directory. An included module can reference other modules not explicitly mentioned in the DIRECTORY of the program being compiled. In some circumstances, the compiler must access such an implicitly included module and must find the exact version referenced. These circumstances are not easy to characterize precisely but usually arise because the compiler needs information about the internal structure of an enumeration or record type in the implicitly referenced module.
Currently, there is no good way of finding the chain of dependencies that leads to a particular implicit reference. In puzzling cases, you or, more likely, a wizard can use the SymbolLister in a rather awkward and painful way to get this information. Listing the symbols of the explicitly included modules (possibly iterating until closure) generates a list of all possible references and the reference paths.
<expr> has a size exceeding implementation limits
Assignment, comparison or allocation (using NEW) of an object with size exceeding 216-1 words. Alternatively, indexing of an array or sequence with components having a size exceeding 216-1 words.
<id> has a type illegal for a tag
Not an enumerated type for a variant tag, or not an index type for a sequence tag.
<expr> has a type with no <operator> operation
Operator missing from the cluster of the type. See section 4.
<expr> has an invalid default
Specifying a TRASH (NULL) default for a type that would inherit a default initial value not including TRASH as an alternative.
Alternatively, using the special form (bracketed expression) that allocates a STRING body as a default specification or as an initial value in NEW.
Alternatively, a formal result variable of an INLINE procedure that is unnamed but has a (non-TRASH) default initial value (implementation shortcoming).
<expr> has incorrect or ambiguous length
Usually, a LOOPHOLE to a type with a size not equal to the size of its operand, or an operation such as comparison on sequences or undiscriminated variant records in which different variants have different sizes.
Alternatively, assorted size problems, including
. an access to a variable or field with zero size (i.e., an empty subrange or array)
. a conditional expression in which not all alternatives have the same sizes
. incorrect size of a state vector (wizards only).
<expr> has incorrect type
Usually, a type that is not compatible with, and cannot be coerced to, some target type implied by the context. See section 4.
Note: The default safety attribute of a proc or signal type depends upon whether CEDAR appears in the header of the module defining the type; type constructors that look identical can differ in the value of this attribute and can cause puzzling instances of this message.
Alternatively, a long (32 bit) value as a test selecting a case arm, when the value of the corresponding case selector is short (Implementation shortcoming).
Alternatively, a catchall for assorted type errors including the following:
. a conditional expression in which the alternatives have incompatible types
. no NARROW operation for a value requiring narrowing to the target type
. a list constructor when the target type is not a list or REF ANY type
. extraction from a value that does not have a record type
. a catch label that does not have a signal or error type
. a qualifier of NEW or FREE that is not a zone
. a READONLY operand of FREE
. incorrect pairing of base and relative pointers
. OPEN of an object that does not have a record type.
<id> has invalid field width or alignment
Violation of assorted restrictions in the definition of a MACHINE DEPENDENT record with explicitly specified field positions:
. a record bigger than a word but not an integral number of words
. a (non-variant) field bigger than a word but not an integral number of words or not word aligned
. a tag field not at the beginning of a variant or sequence part
. size of a variant part not equal to the size of the biggest variant
. size of a sequence part not equal to that of the sequence with zero items
. indexable part of a sequence not word aligned
<id> has no exportable value
An exported procedure with an INLINE body, or an exported variable with = initialization to a constant.
<expr> has no <operator> operation
Its value (a type) does not have the indicated attribute or operator in its cluster. See section 4.
<expr> has no variants
In a (non-copying) WITH ... SELECT discrimination, the selector does not designate a variant record.
<expr> has nonconstant value
In a context in which the language definition requires an expression with a value that can be computed statically by the compiler. Note that a default specified as part of a type (not procedure) declaration in a DEFINITIONS module must be constant.
In an expression used as part of a subrange type definition or as the size of an opaque type, calls of INLINE procedures are not allowed. In other contexts, the expansions of such procedures are used in determining whether a value is constant, but you should not count on the compiler's eliminating any but the simplest forms of INLINE bodies.
<expr> has signed/unsigned ambiguity
Operands in the expression are neither both signed nor both unsigned (according to the rather arcane rules used by Cedar). Alternatively, a subrange or interval with such endpoints.
This is an error for those operators in which the resulting bit pattern is dependent upon the representation assumed (e.g., /, <); otherwise it is a warning.
<id> has unknown or ill-defined size
Declaration or allocation of a variable or field with a type having no well-defined size (e.g., a sequence or a size-unknown opaque type).
Alternatively, a recursive type definition or chain of definitions giving a type with indeterminate or impossible constraints on its size (e.g., by mentioning T.SIZE within the definition of T).
illegal index type
Use of a long (32 bit) index type in defining an array or sequence type (implementation shortcoming).
illegal initialization to body
Binding or assigning a procedure body to an identifier that does not have a proc type or that has a proc type with ANY as domain or range.
illegal initialization to MACHINE CODE
Binding a MACHINE CODE body to an identifier that does not have a proc type.
illegal REJECT or RESUME
Not within a catch phrase; alternatively, a RESUME in a catch phrase for ANY, for an ERROR, or for multiple SIGNALs with different types.
illegal RETURN
In a catch phrase or PROGRAM body; alternatively, RETURN WITH ERROR in a catch phrase.
illegal STOP
Not in a main PROGRAM body, or in a PROGRAM body that returns a result.
implicit system call
Use of a language primitive that is implemented by out-of-line code. This error is enabled only by the y compilation switch (for wizards only, and probably not even for them anymore).
improper use of an unsafe block
An UNCHECKED block as the body of a procedure with a SAFE type, as the arm of a catch phrase for a signal with a SAFE type, or as a statement in a CHECKED block.
Use TRUSTED if you want to suppress the compiler's checking in these situations. Note that the default safety attributes of proc types and the default checking attributes of blocks both depend upon whether CEDAR appears in the module header.
<id> improperly defined for a DEFINITIONS module
Initialization of a procedure to a body that is not INLINE, or initialization of a variable with ← or with an expression that does not have a constant value.
Alternatively, a named import, or a procedure declaration nested within an INLINE body.
incorrect discrimination
Various intermixings of features from the old (non-copying) and new (copying) forms of WITH ... SELECT discrimination.
index or interval type must be ordered
In defining an array or subrange type, or specifying an interval.
instruction has incorrect length
More than eight bytes grouped as a single instruction in a MACHINE CODE body (wizards only).
interval bounds are out of range
End points of nested subrange types don't nest; alternatively, the base type of subrange is REAL.
invalid attribute combination
Mutually incompatible attributes in a type constructor:
. MONITORED + MACHINE DEPENDENT
. SEQUENCE with * as a tag type
. OVERLAID SEQUENCE
. COMPUTED SEQUENCE, if components are reference-containing
<id> is a misused INTERNAL
Called from other than the body of an ENTRY or INTERNAL procedure, or forked within such a body.
<id> is ambiguous without discrimination
Use of a name that occurs in more than one arm of an OVERLAID variant record, when that use is outside a SELECT arm for a single variant.
<expr> is an improper control variable
Not a simple variable, or a simple variable declared in another module and imported.
<expr> is an incorrectly used inline
In an assignment or comparison requiring a proc value, as the alternative of a proc-valued conditional, in ← initialization, or in a LOOPHOLE.
Also, a fork of an INLINE procedure, or a call of one through a POINTER TO FRAME.
<id> is an unmatched implicit import
No principal instance of an implicitly imported interface when it is needed to bind the imported objects (inlines or variables) of another imported interface. Either there are multiple explicitly imported instances of the needed interface, or there are none but adding the name of that interface to the IMPORTS list would create a name conflict. This situation can arise only when importing an interface that itself imports other interfaces and uses inlines, variables, etc. from them.
Alternatively, no principal instance of an interface when it is required by so-called object notation, because the number of explicitly imported instances of that interface is not exactly one.
Note: These errors arise from the interactions of some language misfeatures and some implementation shortcomings. If you are importing multiple instances of an interface and encounter problems, consult a wizard.
<expr> is being assigned out of scope
Into a variable that potentially outlives the nested procedure, signal or error (i.e., one declared within another procedure body). Alternatively, forking a nested procedure, or supplying a nested procedure as an argument of a forked procedure. These are flagged as an error in CHECKED regions only.
<expr> is discriminated unsafely
Old (non-copying) form of WITH ... SELECT discrimination applied to a reference-containing record. This is flagged as an error in CHECKED regions only.
<id> is exported with incorrect attributes
A length-specified opaque type that has a default initial value or has a nonstandard implementation of assignment or equality (includes all REF and reference- containing types and most variant record types).
<id> is exported with incorrect SAFE attribute
For an exported value with a proc or signal type. Always accompanied by another message about exporting the name with incorrect type, even if the safety attribute is the only problem.
Note: The default safety attribute of such a type depends upon whether CEDAR appears in the header of the module defining the type; type constructors that look identical can differ in the value of this attribute.
<id> is exported with incorrect type
For an exported procedure, the type of the exported item is not compatible with the type of the interface item. For an exported variable, the type of the exported item is not equivalent to the type of the interface item. For an exported type, the type of the exported item is not TYPE.
Alternatively, a variable with "=" initialization exported to an item that is not READONLY, or an exported type that is itself opaque (implementation shortcoming).
<id> is followed by a gap
In the definition of a MACHINE DEPENDENT record type with explicitly specified field positions, the field does not extend to be contiguous with the next field or, for the last field, to the required alignment boundary.
<id> is INLINE and recursive
Discovered in the process of expanding the inline.
<id> is multiply defined
In a single declaration sequence or USING list.
Note that the formals, results, and outermost locals in a procedure body are considered a single declaration sequence for the purpose of this check. Also, the tag field in a variant record or sequence is considered part of the enclosing declaration sequence.
<id> is multiply defined
As labels in an EXITS or REPEAT clause.
Note that such names form a space entirely disjoint from the name space of normal declarations. See the manual for the details of the exact scope rules for these names.
<id> is not a legal variant tag
In the label of a variant case in a record type definition.
<id> is not a module name
The interface name specified in a DIRECTORY entry does not match the module identifier in the corresponding included file.
Note that the interface name to be matched is the one following "TYPE" in the DIRECTORY entry if that name is present; otherwise, the one preceding the colon.
<id> is not a type
Where the context demands a type.
<expr> is not a variable
Does not designate a variable and cannot be used as the destination of an assignment, as the operand of WAIT, NOTIFY or BROADCAST, or as a monitor lock.
<expr> is not address (@) of a variable
The FREE operation for a counted zone requires an address of a REF variable, explicitly generated using @, as its operand.
<expr> is not importable/exportable
A module importing or exporting itself, or a DEFINITIONS module importing a PROGRAM module.
<id> is not valid as a field selector
Following a dot.
This message often means that the identifier has been omitted from the corresponding USING list. Confusingly, the qualified procedure names in so-called object notation must appear in corresponding USING lists (if present), despite the fact that identifiers of record fields and the like must not.
Note: When referencing an included module, the compiler cannot always distinguish between names that are undeclared and those that are private. Also, a failure to open the BCD file containing an included module can give an unfortunate cascade of these messages.
<id> is not valid as a key
In a keyword constructor.
<id> is out of order
In the declaration of a MACHINE DEPENDENT enumeration, the lexical order and the order implied by the representation specification are different.
<expr> is out of range
Compile-time bounds fault.
<id> is private
In the scope of an OPEN or in a field designator, constructor, extractor, etc. Alternatively, in the USING list for an included module.
<id> is repeated as a key
In a keyword constructor.
<id> is undeclared
In the current scope, or in the included module (for a USING clause), or in an enumeration (for $id as a literal). See the manual for details of the rather confusing scope rules applicable to ENABLE clauses, EXITS, etc.
This message often is a symptom of a mistake in a USING list or OPEN clause.
Note: When referencing an included module, the compiler cannot always distinguish between names that are undeclared and those that are private. Also, a failure to open the BCD file containing an included module can give an unfortunate cascade of these messages.
<expr> is undeclared
As the destination of a GOTO.
Note that such labels constitute a naming space entirely disjoint from the name space of normal declarations. See the manual for the details of the exact scope rules for these labels
keywords not permitted
In various forms that look like procedure calls or record constructors but aren't (indexing, etc.).
<id> labels multiple variants
In the labels of multiple variant cases in a record type definition
<expr> lacks a tag needed for discrimination
Missing selector expression in discriminating a variant record with COMPUTED tag. Alternatively, narrowing such a record.
<id> leads to a circular type definition
Recursive type definition or chain of definitions gives a type with infinite size.
MACHINE CODE cannot be CHECKED
Use TRUSTED.
misplaced catch phrase
In various forms that look like procedure calls but aren't (indexing, constructors, etc.); alternatively, attached to RETURN WITH ERROR.
misplaced EXIT or LOOP
Not within DO ... ENDLOOP brackets (which must be within the same procedure body).
misplaced opaque type declaration
Not at the top level of a DEFINITIONS module.
misplaced RETRY or CONTINUE
In a declaration or an OPEN clause (where these forms are illegal).
misused DESCRIPTOR
In defining a type.
misused LONG
In defining a type.
misused RELATIVE
Base type is not a pointer type, or offset type is neither a pointer nor a descriptor type.
misused VAR
For other than the declaration of an exported variable in a DEFINITIONS module (where either VAR or READONLY is recommended).
mixed explicit and implicit field positions
In defining a record type.
Note: The positions of the variant part and its tag must be specified in a MACHINE DEPENDENT variant record if positions are specified for fields in the common part.
<expr> must be in MDS
Has an address involving a long pointer or ref (currently such an address is disallowed only for a PORT used in a coroutine transfer).
<id> must come from an imported interface
Procedure (including an INLINE) or variable is defined in an included module but is not taken from an imported instance of that module. Note that this can happen either because the module is not imported at all or because the interface type and instance are given different names by the IMPORTS clause and the former is used.
<expr> must have an interface type
In IMPORTS, EXPORTS or SHARES.
<expr> overflows
Compile-time overflow, using the same rules that would be used at runtime if there were complete runtime checking (which there isn't).
Note the interaction with the somewhat unfortunate language rules for lengthening operands. 256*256 overflows, even in a context that eventually requires a long number; 256.LONG*256 does not.
<id> overlaps another field
In the definition of a MACHINE DEPENDENT record type with explicitly specified field positions.
procedure used as a statement returns a value
Also for SIGNAL, JOIN, etc. Prefix "[ ] ←" to discard the value.
<id> required for lock
ENTRY or INTERNAL procedure does not have a formal parameter matching in name and type that of the formal specified in the LOCKS ... USING clause.
<id> requires a base value
Referencing a field of a record in the specification the a default initial value for another field or type declared within the same record.
<id> requires an initial value
Declaration or allocation of a variable with a type that requires an explicit initial value.
<expr> requires explicit type
Because context does not supply enough target information for disambiguation (constructors, NARROW, VAL, etc.).
Anomaly: The constructor of a discriminated variant record requires pieces of the type identifier to appear in two different places. The undiscriminated type is written before the opening bracket of the entire constructor and can be omitted when implied by context. The identifier of the particular variant is written before the bracket opening the variant part and can never be omitted, even when it is implied by context.
Another anomaly: For VAL and ALL, you can't supply the type explicitly but must introduce and initialize a variable or use some similar artifice.
<expr> specifies an inadmissable test
In a WITH ... SELECT discrimination, the label of a case arm is not a literal or does not test for simple equality.
state vector has improper offset
State vector is not a local variable or was assigned too large an offset for the instructions that save and restore processor state (wizards only).
string literals not permitted in DEFINITIONS
Implementation shortcoming.
<number> too few elements in list
Usually in a positional constructor; alternatively, in the operand lists of assorted builtin operations that use funtion-like notation.
Note: The compiler will have used any available defaults to lengthen the list before issuing this message.
<number> too many elements in list
Usually in a positional constructor; alternatively, in the operand lists of assorted builtin operations that use funtion-like notation.
<number> too many exported variables
More than 64 variables declared in a single DEFINITIONS module.
<number> too many interface items
A total of more than 2048 (non-INLINE) procedures, signal, errors, variables and opaque types declared in a single DEFINITIONS module.
<number> too many procedure or signal definitions
More than 127 (non-INLINE) procedures or more than 128 signal and error CODEs declared in a single PROGRAM module.
type must be MACHINE DEPENDENT
Representation specifications used in defining an enumerated type.
unimplemented construct
Internal consistency failure that leaves the compiler in a clean state. See section 1.3. Occasionally a side effect of previous errors.
Alternatively, attempted use of some partially implemented new features related to PAINTED and VAR types.
unmonitored ENTRY or INTERNAL
Not in a MONITOR.
unmonitored WAIT or NOTIFY
Not in the body of an ENTRY or INTERNAL procedure.
unrecognizable type constructor
Application of FRAME to a non-proc, non-program value, or compiler confusion (perhaps because of other errors).
<expr> uses an unsafe operation
Usually, calling an UNSAFE procedure or raising an UNSAFE signal. Alternatively, assorted constructs invoking unsafe builtin operations, including
. port call or JOIN
. indexing an array descriptor
. dereferencing a relative pointer
. loading or storing processor state (wizards only)
This is flagged as an error in CHECKED regions only. Note that the default safety attribute of a proc or signal type depends upon whether CEDAR appears in the header of the module defining the type.
<expr> uses an unsafe <operator> operation
Note that field selection, indexing or procedure application can force automatic dereferencing of the left operand. If such dereferencing is unsafe, the operator reported is the implicit ^. These errors are flagged in CHECKED regions only.
variable or field too large
A type with size greater than 228-1 words or 212-1 words (maximum depends on context).