diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2024-04-29 21:17:20 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2024-04-29 21:17:50 +0200 |
commit | 73ada458ec3b9587fce9263f2f054dc6474ee80b (patch) | |
tree | e230bdc87d4126458b901445a9b26fa1bd3740c8 | |
parent | bcec2e72909bc63bdc2cb88808789a04f3a13d72 (diff) | |
download | rebel-73ada458ec3b9587fce9263f2f054dc6474ee80b.tar rebel-73ada458ec3b9587fce9263f2f054dc6474ee80b.zip |
rebel-lang: typing: do not accept _ in expressions
_ is a pattern, not an expression.
-rw-r--r-- | crates/rebel-lang/src/typing.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crates/rebel-lang/src/typing.rs b/crates/rebel-lang/src/typing.rs index 70fc759..140b8cb 100644 --- a/crates/rebel-lang/src/typing.rs +++ b/crates/rebel-lang/src/typing.rs @@ -330,10 +330,8 @@ impl Type { } fn path_expr_type(ctx: &Context, path: &ast::Path<'_>) -> Result<Type> { - use Type::*; - if path.components == [ast::Ident { name: "_" }] { - return Ok(Free); + return Err(TypeError); } ctx.vars |