Logo fantomas

InvariantViolationException Type

Raised when Fantomas reaches a state that its own model says is impossible, for example a chain whose parts do not fit the shape the transformer guarantees. Unlike the other exceptions here, this never indicates a problem with the code being formatted: it is a bug in Fantomas, or a change in how the F# parser groups expressions. Failing loudly is deliberate — the alternative is silently dropping parts of the source.

Constructors

Constructor Description

InvariantViolationException(msg, range)

Full Usage: InvariantViolationException(msg, range)

Parameters:
    msg : string
    range : range

Returns: InvariantViolationException
msg : string
range : range
Returns: InvariantViolationException

InvariantViolationException(msg, range, syntaxNode)

Full Usage: InvariantViolationException(msg, range, syntaxNode)

Parameters:
    msg : string
    range : range
    syntaxNode : string

Returns: InvariantViolationException
msg : string
range : range
syntaxNode : string
Returns: InvariantViolationException

Instance members

Instance member Description

this.Invariant

Full Usage: this.Invariant

Returns: string

The invariant that was violated, on one line, without the location or the "please report" suffix. A caller that positions the violation against the source itself reports this and draws the rest from `Range`.

Returns: string

this.Range

Full Usage: this.Range

Returns: range

The source range of the construct that triggered the violation.

Returns: range

this.SyntaxNode

Full Usage: this.SyntaxNode

Returns: string

The syntax tree node that triggered the violation, dumped in full, or an empty string when there is none to show. This is what a maintainer triaging the issue needs and what whoever filed it does not, so it is kept off the message and reported at detailed verbosity.

Returns: string

Type something to start searching.