Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Error type?

Definition 4.7 University Computer Science — Year 3 · Capítulo 4 — Abstract Syntax and Semantic Analysis

An error type is a type given to an expression that has already been reported as wrong. Every rule accepts it in place of any type, without a message, and an operator whose operand has it gives it to its own result when the result type depends on the operand.

The expression (zz + 1) * 2 < 3 && true with zz undeclared. If an unknown name stopped every rule above it, each operator would complain about an operand it cannot type (red). With the error type, only the cause is reported; + still gives an int, and the rest of the tree is checked normally.
The expression (zz + 1) * 2 < 3 && true with zz undeclared. If an unknown name stopped every rule above it, each operator would complain about an operand it cannot type (red). With the error type, only the cause is reported; + still gives an int, and the rest of the tree is checked normally.
Ler no capítulo →