mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Basic string type
This commit is contained in:
parent
36b0037145
commit
477cfc4d0d
2 changed files with 11 additions and 0 deletions
|
@ -1803,6 +1803,8 @@ WithPredicate<TypeId> TypeChecker::checkExpr(const ScopePtr& scope, const AstExp
|
||||||
result = checkExpr(scope, *a);
|
result = checkExpr(scope, *a);
|
||||||
else if (auto a = expr.as<AstExprIfElse>())
|
else if (auto a = expr.as<AstExprIfElse>())
|
||||||
result = checkExpr(scope, *a, expectedType);
|
result = checkExpr(scope, *a, expectedType);
|
||||||
|
else if (auto a = expr.as<AstExprInterpString>())
|
||||||
|
result = {stringType};
|
||||||
else
|
else
|
||||||
ice("Unhandled AstExpr?");
|
ice("Unhandled AstExpr?");
|
||||||
|
|
||||||
|
|
|
@ -813,6 +813,15 @@ end
|
||||||
LUAU_REQUIRE_NO_ERRORS(result);
|
LUAU_REQUIRE_NO_ERRORS(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE_FIXTURE(Fixture, "tc_interpolated_string_basic")
|
||||||
|
{
|
||||||
|
CheckResult result = check(R"(
|
||||||
|
local foo: string = `hello {"world"}`
|
||||||
|
)");
|
||||||
|
|
||||||
|
LUAU_REQUIRE_NO_ERRORS(result);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If it wasn't instantly obvious, we have the fuzzer to thank for this gem of a test.
|
* If it wasn't instantly obvious, we have the fuzzer to thank for this gem of a test.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue