Checked by the Parser Family / Syntax Checker:

  • label/end identifiers match.
  • Numeral radixes are between 2 and 16.
  • Numerals contain no more than one `.' character.
  • The opening and closing marks of string/character literals "match", i.e., it is not the case that one is curly and the other neutral, for example.
  • There is no lopsided juxtaposition.
  • Comment delimiters are properly balanced.
  • Operator fixity rules are obeyed.
  • Maximal base operators do not overlap.
  • No superscripted postfix operator is immediately followed by a word character other than apostrophe.
  • None of the characters in a character literal are a string literal delimiter that is not immediately preceded by a backslash.
  • All character literal escape sequences are well-formed.
  • No forbidden whitespace character appears in a Fortress program (see F1.0 beta Section 5.1).
  • Characters allowed only within comments do not appear outside of comments (see F1.0 beta Section 5.1).
  • No unescaped right double quotation mark appears outside a comment and does not delimit a string literal.
  • It is a static error for a Fortress program to contain any control character other than the above-listed whitespace characters, except that the character "SUBSTITUTE" (U+001A; also known as "control-Z") is allowed and ignored if it is the last character of a program.
  • Ampersands do not appear in inappropriate places.
  • None of the enclosed characters of a character literal is a line feed, form feed, carriage return, or any character forbidden outside comments in a Fortress program.
  • No line terminal appears within a string literal.
  • Every word must be one of: reserved word, boolean literal, numeral, identifier, operator token, or else part of a comment or string or character literal.
  • All hidden field declarations in traits are settable. #177
  • No two import statements are identical. #243
  • There is at most one on-demand import statement from a single API. #244
  • Getters should have no arguments. #238
  • A coercion declaration should have exactly one parameter, should not have an explicitly declared return type, should explicitly declare its parameter type, and should have its body expression.
  • Operator declarations are not allowed in block expressions.
  • The object equivalence operator, SEQV, is not overridden. #176
  • An infix/multifix operator declaration must not have any keyword parameters. An operator declaration for superscripting should have exactly two (plain) value parameters. A postfix operator declaration must have one value parameter, which must not be a keyword parameter or a varargs parameter.
  • Bracketing functional method declarations are not allowed.
  • If a return type is given in a subscripted assignment operator method declaration, it must be ().

Checked by the Index Builder:

  • Getter and setter names don't overlap with dotted method names, and setters aren't overloaded. #239
  • If trait T excludes trait U, no third trait may extend both T and U, nor may either T or U extend the other.
  • Getters must always be called with the field reference syntax.

Checked by the Disambiguator:

  • Variables (static and dynamic) are not shadowed.
  • No two explicit declarations with overlapping reaches declare the same name.
  • All references to names are in scope.
  • Unqualified variable/type references are unambiguous.
  • A naked type variable must not appear in the extends clause of a trait or object declaration, nor as the type of a wrapped field.
  • Same name may be declared in different namespaces without restriction.
  • When importing operators, for ordinary operators, we import all declarations--no specification of fixity. For vertical-line operators, the infix/multifix version is imported as a "opr |" while the enclosing version is imported as "opr | |".

Checked by the Static Checker

Checked by the Type Hierarchy Checker:

  • Type hierarchy is acyclic without coercions.
  • Type comprises clauses and extends clauses are consistent. comprises clause in component must completely enumerate its immediate subtypes.
  • Type hierarchy is acyclic including coercions (after the Coercion Oracle). #168
  • Every type listed in a comprises clause of a trait must be declared in the component or API declaring the trait.

Checked by the Type Well-Formedness Checker:

  • Types are well-formed. #192

Checked by the Coercion Oracle:

  • No coercion is from a subtype to a supertype. #169

Checked by the Type Checker:

  • Every type appearing in a throws clause is a subtype of CheckedException.
  • Immutable variables are not modified.
  • Function arguments without default values are provided at call sites.
  • exit targets are in scope.
  • The operators = and IN are defined appropriately for the types at each case expression.
  • Setters must return void. #238
  • Juxtaposition rules are respected. #212

Checked by TypesUtil.assertAfterTypeChecking:

  • AST nodes ArrayType, MatrixType, and _InferenceVarType are removed.

Checked by the Overloading Checker / Abstract Method Checker:

  • The parameter type of a setter must be the same as the return type of a getter with the same name, if any. #338
  • All inherited abstract methods in object definitions and object expressions are defined, with compatible signatures and modifiers. #175
  • A functional which takes a single parameter of a parametric type bound by Any cannot be overloaded.
  • There are no new functional methods defined by an object expression.

Checked by the Export Checker:

  • All types in exported APIs are defined by non-private definitions and all methods in those types have appropriate signatures and modifiers. #172
  • All functions and top-level variables in exported APIs are defined with appropriate signatures and modifiers. #174

Not Yet Implemented:

Global checks:

  • [NYI] Implement dimension / unit checking. #188
  • [NYI] Implement algebraic static parameters. #348
  • [NYI] Overloaded functional declarations are well-formed. #170
  • [NYI] Check that compound APIs are well formed. #344
  • [NYI] Any functional that performs an I/O action must be declared with the io modifier. #346
  • [NYI] All variables are definitely assigned to before use. #262
  • [NYI] Fields of value objects are not modifiable. #186
  • [NYI] typecase clauses are jointly exhaustive. #193
  • [NYI] Qualified references are unambiguous. #195

Total coverage of types:

  • [NYI] Abstract function declarations should be covered by a set of concrete function declarations in a component. For an abstract function declaration with name f, argument type T, and return type U, any concrete declaration for f must be a function whose argument type is a subtype of T and whose return type is a subtype of U. The union of the argument types of the concrete declaration for f must be equal to T.
  • [NYI] The union of the guarding types of a typecase expression must cover the static type of the expression(s) being bound (a tuple type if there are multiple bindings). #234

Exceptions:

  • [NYI] All thrown checked exceptions in a functional are declared to be thrown (or one of their supertypes is declared to be thrown). #178
  • [NYI] No initialization expression of a top-level variable declaration throws a checked exception. #180

Future Checks

Global checks:

  • [NYI] For "value" objects and traits, setters return a new instance of the object with the "set" field changed rather than void. #337
  • [NYI] If a trait declaration has the value modifier then every trait (including object traits) that extends it must also have the value modifier.
  • [NYI] Parameterized type aliases must not be recursive.
  • [NYI] Tuple expressions/types with varargs and/or keywords are well formed. #347
  • [NYI] Type aliases are satisfied only by declarations that are the same (minor lexical differences permitted--see footnote 2 on page 173 in F1.0b).
  • [NYI] Implement override keyword and the static checks associated with it.
  • [NYI] Allow scripting interface: only import statements followed by block elements.

Static expressions:

  • [NYI] There is no range expression of the form a:b:c where c is the static expression 0. #200
  • [NYI] Functions are well-defined on static arguments. For example, gcd is not applied to non-integer values.

Tests and properties:

  • [NYI] Non-test code does not refer to test code. #225
  • [NYI] Expression in a property declaration must have type Boolean. Property functions must not be overloaded with non-property functions.
  • [NYI] Test and property declarations are satisfied by declarations that are the same (minor lexical differences permitted--see footnote 2 on page 173 in F1.0b).
  • [NYI] Property functions can only be called by test code.

Operator parameters:

  • [NYI] An operator method declaration that declares an operator name that is an operator parameter of an enclosing trait or object declaration must satisfy the overloading rules with all operator declarations that it could be overloaded with.
  • [NYI] An operator cannot instantiate more than one operator parameter of a single trait or object.
  • [NYI] An operator method delcaration whose name is one of the operator parameters of its enclosing trait may be overloaded with other operator declarations in the same component. Such a declaration must satisfy the overloading rules.

Where clauses:

  • [NYI] Where-clause variables must be bound by a where clause.
  • [NYI] All static variables in a trait, object or functional declaration must occur either as a static parameter or a where-clause variable.

Syntactic abstraction:

  • [NYI] No local declarations occur at grammar def sites. #219
  • [NYI] All APIs imported at a grammar definition are imported at use sites. #220
  • [NYI] Grammar extensions are acyclic. #221
  • [NYI] Grammar productions are well-formed. #222
  • [NYI] Template definitions have appropriate types and dimensions (we're still working out what this means, exactly). #223
  • [NYI] Macro use sites are well-formed and all contained expressions have appropriate types. #224

Matrix pasting/unpasting:

  • [NYI] Matrix unpasting LHS's are well-formed. #229
  • [NYI] Matrix unpastings are guarranteed to cover unpasting RHSs exactly (this is not in 1.0 beta, but we might require it to prevent runtime UnpastingExceptions). #230
  • [NYI] The elements along a row (or column) of an array expression must have the same number of columns (or rows), though two elements in different rows (or columns) need not have the same number of columns (rows).

ASCII conversion:

  • [NYI] After ASCII conversion, an ampersand outside of any comment or string or character literal must be immediately followed by a line terminator or line terminating comment.

Other Checks

  • [NYI] Method contracts and overloaded functional contracts preserve substitutability under subtyping. #232
  • [NYI] Design and implement the checks necessary for a sounds component system. #173
  • [NYI] Add indices for APIs and components to the cache/repository. #196
  • [NYI] Arrays never contain arrays as elements.

Tickets on the Static Checkers

  • #289: Static analysis uses name of static opr parameter as (functional) method name
  • #332: Static tests overwrite .class file generated by testSystem
  • #233: Abstract function declarations should be covered by a set of concrete function declarations in a component.
  • #246: type checker gives the wrong type to a field that is declared as an abstrct field in super trait
  • #259: type checker appears to find missing library definition for MAX and MIN for ZZ32
  • #260: the type checker cannot handle a simple list comprehension
  • #264: Type checker infers BottomType for the return type of a function declaration.
  • #265: Type checker throws the OptionUnwrapException for the seq method defined in FortressLibrary
  • #308: Static checking fails to reject static parameterized reference to missing function
  • #286: Use of a "naked" getter not rejected by disambigutor
  • #306: Redundant declarations are not flagged as static errors
  • #287: static param declared by nested FnDef not recognized by type checker
  • #323: Type names and function names should be in disjoint namespaces.
  • #254: Implement the new string concatenation and juxtaposition story