summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2024-05-16 13:05:41 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2024-05-16 13:05:41 +0200
commit34e3bbfa376c97fd7ab38c0946949be42dc352d4 (patch)
treefc9e97c0d3e42bc67f1c8b10ba30f3531a25b3af
parent5f5102d9964655b99701077786d3f4a4f9f27f92 (diff)
downloadrebel-34e3bbfa376c97fd7ab38c0946949be42dc352d4.tar
rebel-34e3bbfa376c97fd7ab38c0946949be42dc352d4.zip
rebel-lang: allow free types in string interpolation
Free types should only appear as the inner type of empty arrays and options, so we can allow them.
-rw-r--r--crates/rebel-lang/src/typing.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/rebel-lang/src/typing.rs b/crates/rebel-lang/src/typing.rs
index f15cbc4..3ee681a 100644
--- a/crates/rebel-lang/src/typing.rs
+++ b/crates/rebel-lang/src/typing.rs
@@ -493,6 +493,7 @@ impl<'scope> Context<'scope> {
fn check_string_interp_type(typ: Type, kind: expr::StrKind) -> Result<()> {
match (typ, kind) {
+ (Type::Free, _) => Ok(()),
(Type::Bool, _) => Ok(()),
(Type::Int, _) => Ok(()),
(Type::Str, _) => Ok(()),