nushell/crates/nu-std/std
WindSoilder 724818030d
add type check during eval time (#11475)
# Description
Fixes: #11438 

Take the following as example:
```nushell
def spam [foo: string] {
    $'foo: ($foo | describe)'
}
def outer [--foo: string] {
    spam $foo
}

outer
```
When we call `outer`, type checker only check the all for `outer`, but
doesn't check inside the body of `outer`. This pr is trying to introduce
a type checking process through `Type::is_subtype()` during eval time.

## NOTE
I'm not really sure if it's easy to make a check inside the body of
`outer`. Adding an eval time type checker seems like an easier solution.
As a result: `outer` will be caught by runtime, not parse time type
checker

cc @kubouch 

# User-Facing Changes
After this pr the following call will failed:
```nushell
> outer
Error: nu:🐚:cant_convert

  × Can't convert to string.
   ╭─[entry #27:1:1]
 1 │ def outer [--foo: any] {
 2 │     spam $foo
   ·          ──┬─
   ·            ╰── can't convert nothing to string
 3 │ }
   ╰────
```

# Tests + Formatting
Done

# After Submitting
NaN
2024-01-12 23:48:53 +08:00
..
assert.nu Refactor error make (#10923) 2023-11-03 10:09:33 -05:00
dirs.nu Refactor error make (#10923) 2023-11-03 10:09:33 -05:00
dt.nu Refactor error make (#10923) 2023-11-03 10:09:33 -05:00
formats.nu add to ndjson and to jsonl to the standard library (#10519) 2023-10-02 11:50:07 +02:00
help.nu Refactor error make (#10923) 2023-11-03 10:09:33 -05:00
input.nu Command to get individual keys (#9453) 2023-07-03 10:23:44 -05:00
iter.nu Add long options for filters (#10641) 2023-10-08 13:12:46 +02:00
log.nu add type check during eval time (#11475) 2024-01-12 23:48:53 +08:00
math.nu move math constants to standard library (#9678) 2023-09-05 19:32:31 +02:00
mod.nu remove std clip (#11131) 2024-01-08 21:46:10 +02:00
testing.nu deprecate std testing (#11151) 2023-12-02 13:15:47 +01:00
xml.nu Refactor error make (#10923) 2023-11-03 10:09:33 -05:00