E4194

E4194#

Compiler diagnostic name: unsupported_declaration.

Unsupported declaration target.

The declaration-only attribute is supported only on declaration items that the compiler can later match with an implementation. It cannot be applied to ordinary value bindings or other unsupported top-level items.

Erroneous example#

#declaration_only
let answer = 42

answer is a let binding, not a function, type, or implementation relation that can be tracked as a declaration.

Suggestion#

Use an ordinary definition for values. If you need a declaration, declare a function signature, abstract type, or implementation relation.

let answer = 42