Rule 7.8
On this page

Rule 7.8

Chapter 7, Expressions and statements Test

The refusals of surface §28 (a union of two GPU types, a string type, a nullable, a mixed tuple, a rest tuple, symbol, an intersection of carriers, instanceof, in) must apply to expressions as they do to types, each in one sentence. The one string an expression may be is a string literal written as an argument of a console call: it is a label, which the host keeps and the event carries in its place, and it never reaches a target (surface §66). A template with a value in it is refused there with the arguments to write instead.

The rule text and the parts under it are the compiler's own English, as the design document writes them.

Rationale

see Rule 4.5; a label is text a human reads, which belongs on the host, and a console call is the one place the host receives it.

Derives from

surface §28 and §66; changes/0014-gpu-console.md.

How it is verified

Checked by a test. A test, a gate script or a CI workflow names this rule, and the traceability check fails when a file listed below stops naming it.

Where the rule says the compiler enforces it:

src/compiler/ts/honest-refusals.test.ts; src/compiler/ts/console.test.ts, for the label and the template, in the compiler and in the language service.

The files that verify it at commit 26de7be8, each at the first line that names the rule:

Explained in

The sections of the surface document that explain this rule, at commit 26de7be8:

See also

Source

The rule at commit 26de7be8:

Edit this page Report a problem