mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Store region of type annotation correctly
This commit is contained in:
parent
0810d8194e
commit
514af619f5
1 changed files with 3 additions and 1 deletions
|
@ -475,6 +475,8 @@ fn expression<'a>(
|
||||||
space0_before_e(term(min_indent), min_indent, EType::TIndentStart)
|
space0_before_e(term(min_indent), min_indent, EType::TIndentStart)
|
||||||
.parse(arena, state)?;
|
.parse(arena, state)?;
|
||||||
|
|
||||||
|
let region = Region::span_across(&first.region, &return_type.region);
|
||||||
|
|
||||||
// prepare arguments
|
// prepare arguments
|
||||||
let mut arguments = Vec::with_capacity_in(rest.len() + 1, arena);
|
let mut arguments = Vec::with_capacity_in(rest.len() + 1, arena);
|
||||||
arguments.push(first);
|
arguments.push(first);
|
||||||
|
@ -482,7 +484,7 @@ fn expression<'a>(
|
||||||
let output = arena.alloc(arguments);
|
let output = arena.alloc(arguments);
|
||||||
|
|
||||||
let result = Loc {
|
let result = Loc {
|
||||||
region: return_type.region,
|
region,
|
||||||
value: TypeAnnotation::Function(output, arena.alloc(return_type)),
|
value: TypeAnnotation::Function(output, arena.alloc(return_type)),
|
||||||
};
|
};
|
||||||
let progress = p1.or(p2).or(p3);
|
let progress = p1.or(p2).or(p3);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue