nushell/crates/nu-parser/src
mike 544c46e0e4
improve subtyping (#9614)
# Description

the current subtyping rule needs you to define the record entries in the
same order as declared in the annotation. this pr improves that

now
```nushell
{ name: 'Him', age: 12 } 

# ,

{ age: 100, name: 'It' }

# and

{ name: 'Red', age: 69, height: "5-8" }

# will all match

record<name: string, age: int>

# previously only the first one would match
```

however, something like

```nushell
{ name: 'Her' } # will not


# and

{ name: 'Car', wheels: 5 }
```

EDIT: applied JT's suggestion
2023-07-06 10:25:39 +02:00
..
deparse.rs allow empty string arguments (#9420) 2023-06-13 07:30:30 -05:00
eval.rs Allow duration defaults (#9249) 2023-05-20 08:23:25 -05:00
flatten.rs Avoid blocking when o+e> redirects too much stderr message (#8784) 2023-05-17 17:47:03 -05:00
known_external.rs Document and critically review ShellError variants - Ep. 3 (#8340) 2023-03-06 18:33:09 +01:00
lex.rs allow comment in multiple line pipeline (#9436) 2023-06-15 13:11:42 +02:00
lib.rs Add virtual path abstraction layer (#9245) 2023-05-23 23:48:50 +03:00
lite_parser.rs Let with pipeline (#9589) 2023-07-03 17:45:10 +12:00
parse_keywords.rs Remove unnecessary parentheses (#9605) 2023-07-04 11:12:46 +02:00
parse_patterns.rs Cut down on unnecessary parsing for SyntaxShape::Any (#9280) 2023-05-25 07:53:57 +12:00
parser_path.rs Add virtual path abstraction layer (#9245) 2023-05-23 23:48:50 +03:00
parser.rs Let with pipeline (#9589) 2023-07-03 17:45:10 +12:00
type_check.rs improve subtyping (#9614) 2023-07-06 10:25:39 +02:00