Skip to content

Experimental Option Tracking: enforce-runtime-annotations #16832

@mkatychev

Description

@mkatychev

Identifier

enforce-runtime-annotations

Introducing PR

#16079

Status

opt-in

Description

Enforce type checking of let assignments at runtime so that invalid type conversion errors propagate the same way they would for predefined values:

Error: nu::parser::type_mismatch

  × Type mismatch.
   ╭─[example1.nu:2:32]
 1 │ let table1: table<a: string> = [{a: "foo"}]
 2 │ let table2: table<b: string> = $table1
   ·                                ───┬───
   ·                                   ╰── expected table<b: string>, found table<a: string>
   ╰────

Related

#16530

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions