[trivial] Fix foreach range tuple element error message

This commit is contained in:
Nick Treleaven 2024-06-28 13:35:48 +01:00 committed by The Dlang Bot
parent c29c71cb1e
commit be5dd7c25e
2 changed files with 2 additions and 2 deletions

View file

@ -1381,7 +1381,7 @@ Statement statementSemanticVisit(Statement s, Scope* sc)
p.type = p.type.addStorageClass(sc).typeSemantic(loc, sc2); p.type = p.type.addStorageClass(sc).typeSemantic(loc, sc2);
if (!exp.implicitConvTo(p.type)) if (!exp.implicitConvTo(p.type))
{ {
error(fs.loc, "cannot implicilty convert range element of type `%s` to variable `%s` of type `%s`", error(fs.loc, "cannot implicitly convert tuple element of type `%s` to variable `%s` of type `%s`",
exp.type.toChars(), p.toChars(), p.type.toChars()); exp.type.toChars(), p.toChars(), p.type.toChars());
return retError(); return retError();
} }

View file

@ -3,7 +3,7 @@
/* /*
TEST_OUTPUT: TEST_OUTPUT:
--- ---
fail_compilation/fail13577.d(27): Error: cannot implicilty convert range element of type `int[]` to variable `x` of type `immutable(int[])` fail_compilation/fail13577.d(27): Error: cannot implicitly convert tuple element of type `int[]` to variable `x` of type `immutable(int[])`
--- ---
*/ */