Errors produced while desugaring SurfaceTLAPlus/SurfacePlusCal into CoreTLAPlus/CorePlusCal.
- misplacedAt
(pos : SourceSpan)
: DesugarError
@used outside of anEXCEPTupdate. - gotoNotInTailPosition
(pos : SourceSpan)
: DesugarError
A
gotois followed by more unlabelled statements — unreachable dead code (agotofollowed by a label is fine). - unlabelledStatement
(pos : SourceSpan)
: DesugarError
A statement appears before the first label of its enclosing thread — there is no label to attach it (or the block it starts) to.
- nestedLabel
(pos : SourceSpan)
: DesugarError
A label appears inside a
withbody — never allowed, since awithbinding only makes sense within one atomic step. - whileInWith
(pos : SourceSpan)
: DesugarError
A
whilestatement appears inside awithbody, at any nesting depth. - whileNotLabelled
(pos : SourceSpan)
: DesugarError
A
whilestatement is not immediately preceded by a real, user-written label; none is auto-inserted. - notFollowedByLabel
(pos : SourceSpan)
: DesugarError
A statement following an
if/eitherthat contains a labelled statement or agotoanywhere within it is not itself labelled. - withBoundVarWritten
(pos : SourceSpan)
(name : String)
: DesugarError
A statement writes into a variable currently bound by an enclosing
with— anassigntarget or areceive's targetRef. Awith-bound name is a fixed local binding, not a process variable, so writing to it is meaningless. - wrongAnnotationKindAtSite
(pos : SourceSpan)
(found expected : String)
: DesugarError
An annotation-carrying slot only accepts specific kinds of annotation, but a different kind was found there.
- duplicateAnnotation
(pos : SourceSpan)
(kind : String)
: DesugarError
Two or more annotations of the same kind found at one slot, for a kind whose content can actually differ between instances (
@type,@mailbox). Content-free markers (@parameter) get a warning instead (DesugarWarning.duplicateParameterAnnotation). - conflictingAssignment
(pos : SourceSpan)
(name : String)
: DesugarError
The same bare variable (no index —
x, notx[…]) is written more than once within one atomic step (assign/receive, any combination), on the same control path. Indexed writes (x[0] := …) aren't tracked by this check. - invalidRecordFieldAccess
(pos : SourceSpan)
: DesugarError
The right-hand side of a record-access
.is not a bare field-name identifier (e.g.r.1,r.(f)). - duplicateMacroDecl
(pos : SourceSpan)
(name : String)
(firstPos : SourceSpan)
: DesugarError
Two
macrodeclarations share a name.firstPosis the earlier one's own span. - labelInMacroBody
(pos : SourceSpan)
: DesugarError
A label appears inside a
macrobody — never allowed, same restriction aswith. - recursiveMacro
(pos : SourceSpan)
(cycle : List (String × SourceSpan))
: DesugarError
The macro call-graph (which macro name each declared macro's own body calls) has a cycle.
posis the flagged declaration's own span;cycleis the chain of calls closing the loop, outermost first, each entry the callee name and the call site inside its caller's body. - undefinedMacro
(pos : SourceSpan)
(name : String)
: DesugarError
A
Name(…)call names no declared macro. - macroArityMismatch
(pos : SourceSpan)
(name : String)
(expected got : ℕ)
(declPos : SourceSpan)
: DesugarError
A macro call's argument count doesn't match its declaration's parameter count.
declPosis the declaration's own span. - macroArgumentNotAssignable
(pos : SourceSpan)
(macroName paramName : String)
(writePos : SourceSpan)
: DesugarError
A macro call's argument is substituted into a parameter that the macro body writes to (
assign/receive's target,send's channel), but the argument itself is not a reference (variable, possibly indexed/field-accessed) that can be written to.writePosis the span of the statement inside the macro body that writes to the parameter. - internalUnexpandedMacroCall
(pos : SourceSpan)
: DesugarError
A
.macroCallreached statement desugaring — every one should have been rewritten away byDesugarer/PlusCalMacros.lean's expansion pass, which runs first inrunDesugarer. Reported as a diagnostic rather thanpanic!/unreachable!, matching this compiler's own instinct of never taking the process down on a "should be impossible" path.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Non-fatal issues found while desugaring — collected out-of-band and filtered/printed once
desugaring returns (Driver/Modules.lean's compileModule).
- duplicateParameterAnnotation
(pos : SourceSpan)
: DesugarWarning
A
@parametermarker repeated on the same variable — content-free, so a warning rather thanDesugarError.duplicateAnnotation. - partialMulticastAnnotation
(pos : SourceSpan)
: DesugarWarning
A
multicastfilter whose components carry@typeannotations on some binds but not all. The desugarer collapses the components into one binder over their Cartesian product, whose declared type is the tuple of theirs — which it can only build when every component supplies one. The annotations that were written are dropped, and the recipient's type comes from the channel's own declared domain instead.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- instReprDesugarWarning = { reprPrec := instReprDesugarWarning.repr }
Equations
Equations
Equations
- instBEqDesugarWarning.beq (DesugarWarning.duplicateParameterAnnotation a) (DesugarWarning.duplicateParameterAnnotation b) = (a == b)
- instBEqDesugarWarning.beq (DesugarWarning.partialMulticastAnnotation a) (DesugarWarning.partialMulticastAnnotation b) = (a == b)
- instBEqDesugarWarning.beq x✝¹ x✝ = false
Instances For
The -W<name>/-Wno-<name> name a given warning is filtered under.
Equations
- (DesugarWarning.duplicateParameterAnnotation a).name = "duplicate-parameter"
- (DesugarWarning.partialMulticastAnnotation a).name = "partial-multicast-annotation"
Instances For
Equations
- One or more equations did not get rendered due to their size.