From ec131b6c7bd27d9034ed5e600b80420d35c00a21 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 6 Nov 2018 21:19:32 +0300 Subject: grammar: fix where clause parsing closes #205 --- crates/ra_syntax/src/grammar/type_params.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/ra_syntax/src/grammar') diff --git a/crates/ra_syntax/src/grammar/type_params.rs b/crates/ra_syntax/src/grammar/type_params.rs index 68eca0ce8..f4c98675c 100644 --- a/crates/ra_syntax/src/grammar/type_params.rs +++ b/crates/ra_syntax/src/grammar/type_params.rs @@ -135,7 +135,11 @@ fn where_predicate(p: &mut Parser) { if p.at(FOR_KW) { types::for_binder(p); } - types::path_type(p); + if paths::is_path_start(p) || p.at(L_ANGLE) { + types::path_type_(p, false); + } else { + p.error("expected a type"); + } if p.at(COLON) { bounds(p); } else { -- cgit v1.2.3