mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-25 06:22:38 +00:00
Add array size deduction from tuple(fix#1590) (#2825)
Allow array size deduction from tuples and arrays on array declaration Closes #1590
This commit is contained in:
1 parent
8ad08e34e2
commit
40b3518d37
21 files changed
+341
-53
No files matched your search
@@ -287,8 +287,11 @@ void Expression::Print(llvm::raw_ostream& out) const {
|
||||
}
|
||||
case ExpressionKind::ArrayTypeLiteral: {
|
||||
const auto& array_literal = cast<ArrayTypeLiteral>(*this);
|
||||
out << "[" << array_literal.element_type_expression() << "; "
|
||||
<< array_literal.size_expression() << "]";
|
||||
out << "[" << array_literal.element_type_expression() << ";";
|
||||
if (array_literal.has_size_expression()) {
|
||||
out << " " << array_literal.size_expression();
|
||||
}
|
||||
out << "]";
|
||||
break;
|
||||
}
|
||||
case ExpressionKind::IdentifierExpression:
|
||||
|
||||
Reference in new issue
Block a user