Skip to content

Commit

Permalink
Change wording of type warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
thehans committed Dec 6, 2022
1 parent 82cdc92 commit 0deb275
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/core/Parameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ void print_argConvert_positioned_warning(
}
message << ")";
}
message << ", found " << Value::typeName(found.type()) << " " << "(" << found.toEchoStringNoThrow() << ")";
message << ", found " << found.typeName()) << " " << "(" << found.toEchoStringNoThrow() << ")";
LOG(message_group::Warning, loc, documentRoot, "%1$s", message.str());
}

Expand All @@ -288,7 +288,7 @@ void print_argConvert_warning(
const std::string& documentRoot
) {
std::stringstream message;
message << calledName << "(..., " << argName << "=" << found.toEchoStringNoThrow() << ") parameter could not be converted: expected ";
message << calledName << "(..., " << argName << "=" << found.toEchoStringNoThrow() << ") Invalid type: expected ";
if (expected.size() == 1) {
message << Value::typeName(expected[0]);
} else {
Expand All @@ -299,6 +299,6 @@ void print_argConvert_warning(
}
message << ")";
}
message << ", found " << Value::typeName(found.type());
message << ", found " << found.typeName();
LOG(message_group::Warning, loc, documentRoot, "%1$s", message.str());
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
WARNING: linear_extrude(..., slices=inf) argument cannot be infinite or nan in file linear_extrude-parameter-tests.scad, line 14
WARNING: linear_extrude(..., slices=-inf) argument cannot be infinite or nan in file linear_extrude-parameter-tests.scad, line 14
WARNING: linear_extrude(..., slices=nan) argument cannot be infinite or nan in file linear_extrude-parameter-tests.scad, line 14
WARNING: linear_extrude(..., slices="") parameter could not be converted: expected number, found string in file linear_extrude-parameter-tests.scad, line 14
WARNING: linear_extrude(..., slices=true) parameter could not be converted: expected number, found bool in file linear_extrude-parameter-tests.scad, line 14
WARNING: linear_extrude(..., slices=[1 : 1 : 3]) parameter could not be converted: expected number, found range in file linear_extrude-parameter-tests.scad, line 14
WARNING: linear_extrude(..., slices="") Invalid type: expected number, found string in file linear_extrude-parameter-tests.scad, line 14
WARNING: linear_extrude(..., slices=true) Invalid type: expected number, found bool in file linear_extrude-parameter-tests.scad, line 14
WARNING: linear_extrude(..., slices=[1 : 1 : 3]) Invalid type: expected number, found range in file linear_extrude-parameter-tests.scad, line 14
WARNING: linear_extrude(..., slices=inf) argument cannot be infinite or nan in file linear_extrude-parameter-tests.scad, line 17
WARNING: linear_extrude(..., slices=-inf) argument cannot be infinite or nan in file linear_extrude-parameter-tests.scad, line 17
WARNING: linear_extrude(..., slices=nan) argument cannot be infinite or nan in file linear_extrude-parameter-tests.scad, line 17
WARNING: linear_extrude(..., slices="") parameter could not be converted: expected number, found string in file linear_extrude-parameter-tests.scad, line 17
WARNING: linear_extrude(..., slices=true) parameter could not be converted: expected number, found bool in file linear_extrude-parameter-tests.scad, line 17
WARNING: linear_extrude(..., slices=[1 : 1 : 3]) parameter could not be converted: expected number, found range in file linear_extrude-parameter-tests.scad, line 17
WARNING: linear_extrude(..., slices="") Invalid type: expected number, found string in file linear_extrude-parameter-tests.scad, line 17
WARNING: linear_extrude(..., slices=true) Invalid type: expected number, found bool in file linear_extrude-parameter-tests.scad, line 17
WARNING: linear_extrude(..., slices=[1 : 1 : 3]) Invalid type: expected number, found range in file linear_extrude-parameter-tests.scad, line 17
WARNING: linear_extrude(..., scale=inf) could not be converted in file linear_extrude-parameter-tests.scad, line 20
WARNING: linear_extrude(..., scale=-inf) could not be converted in file linear_extrude-parameter-tests.scad, line 20
WARNING: linear_extrude(..., scale=nan) could not be converted in file linear_extrude-parameter-tests.scad, line 20
Expand Down
22 changes: 11 additions & 11 deletions tests/regression/echotest/text-metrics-test-expected.echo
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ ECHO: { position = [-116.212, -10.208]; size = [98.96, 20.416]; ascent = 20.1344
ECHO: { nominal = { ascent = 12.5733; descent = -2.9433; }; max = { ascent = 13.6109; descent = -4.2114; }; interline = 15.9709; font = { family = "Liberation Sans"; style = "Regular"; }; }
ECHO: { nominal = { ascent = 25.1466; descent = -5.8866; }; max = { ascent = 27.2218; descent = -8.4228; }; interline = 31.9418; font = { family = "Liberation Sans"; style = "Regular"; }; }
ECHO: "Errors..."
WARNING: textmetrics(..., size=[]) parameter could not be converted: expected number, found vector in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., text=123) parameter could not be converted: expected string, found number in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., spacing="") parameter could not be converted: expected number, found string in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., font=true) parameter could not be converted: expected string, found bool in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., direction=0) parameter could not be converted: expected string, found number in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., language=[0 : 1 : 10]) parameter could not be converted: expected string, found range in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., script=0) parameter could not be converted: expected string, found number in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., halign=0) parameter could not be converted: expected string, found number in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., valign=0) parameter could not be converted: expected string, found number in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., size=[]) Invalid type: expected number, found vector in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., text=123) Invalid type: expected string, found number in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., spacing="") Invalid type: expected number, found string in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., font=true) Invalid type: expected string, found bool in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., direction=0) Invalid type: expected string, found number in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., language=[0 : 1 : 10]) Invalid type: expected string, found range in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., script=0) Invalid type: expected string, found number in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., halign=0) Invalid type: expected string, found number in file text-metrics-test.scad, line 20
WARNING: textmetrics(..., valign=0) Invalid type: expected string, found number in file text-metrics-test.scad, line 20
ECHO: { position = [0, 0]; size = [0, 0]; ascent = 0; descent = 0; offset = [0, 0]; advance = [0, 0]; }
WARNING: variable text not specified as parameter in file text-metrics-test.scad, line 25
WARNING: fontmetrics(..., size=true) parameter could not be converted: expected number, found bool in file text-metrics-test.scad, line 25
WARNING: fontmetrics(..., font=0) parameter could not be converted: expected string, found number in file text-metrics-test.scad, line 25
WARNING: fontmetrics(..., size=true) Invalid type: expected number, found bool in file text-metrics-test.scad, line 25
WARNING: fontmetrics(..., font=0) Invalid type: expected string, found number in file text-metrics-test.scad, line 25
ECHO: { nominal = { ascent = 12.5733; descent = -2.9433; }; max = { ascent = 13.6109; descent = -4.2114; }; interline = 15.9709; font = { family = "Liberation Sans"; style = "Regular"; }; }

0 comments on commit 0deb275

Please sign in to comment.