Skip to content

Make SetType on literals safer #59

@eaburns

Description

@eaburns

A literal node may be the single literal hanging off of a named constant declaration, like pi in this example:

const pi = 3.1415926535

Here, pi is untyped. If SetType is called on its literal then suddenly all references to pi in the remainder of the check will be typed. This is not obvious and will be very hard to debug if it becomes an issue. SetType is dangerous. Instead, we should return a new literal node with the given type.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions