mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
Parse _ in type annotations as an 'Inferred' type
This commit is contained in:
parent
91c97dbba4
commit
7f5b873357
9 changed files with 64 additions and 1 deletions
|
@ -180,7 +180,7 @@ impl<'a> Formattable<'a> for TypeAnnotation<'a> {
|
|||
true
|
||||
}
|
||||
|
||||
Wildcard | BoundVariable(_) | Malformed(_) => false,
|
||||
Wildcard | Inferred | BoundVariable(_) | Malformed(_) => false,
|
||||
Function(args, result) => {
|
||||
(&result.value).is_multiline()
|
||||
|| args.iter().any(|loc_arg| (&loc_arg.value).is_multiline())
|
||||
|
@ -279,6 +279,7 @@ impl<'a> Formattable<'a> for TypeAnnotation<'a> {
|
|||
}
|
||||
BoundVariable(v) => buf.push_str(v),
|
||||
Wildcard => buf.push('*'),
|
||||
Inferred => buf.push('_'),
|
||||
|
||||
TagUnion { tags, ext } => {
|
||||
format_sequence!(buf, indent, '[', ']', tags, newlines, Tag);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue