Account for supertypes during query analysis
This commit is contained in:
parent
5003064da7
commit
21c3bbc4b4
2 changed files with 29 additions and 1 deletions
|
|
@ -291,6 +291,24 @@ fn test_query_errors_on_impossible_patterns() {
|
|||
.join("\n")
|
||||
))
|
||||
);
|
||||
|
||||
Query::new(
|
||||
js_lang,
|
||||
"(if_statement
|
||||
condition: (parenthesized_expression (_expression) @cond))",
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
Query::new(js_lang, "(if_statement condition: (_expression))",),
|
||||
Err(QueryError::Structure(
|
||||
1,
|
||||
[
|
||||
"(if_statement condition: (_expression))", //
|
||||
" ^",
|
||||
]
|
||||
.join("\n")
|
||||
))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue