Skip to content

Commit ea3e606

Browse files
committed
init
1 parent b3b59d7 commit ea3e606

12 files changed

+332
-360
lines changed

compiler/plc_diagnostics/src/diagnostics.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,16 @@ impl Diagnostic {
199199
.with_error_code("E006")
200200
}
201201

202-
pub fn invalid_parameter_count(expected: usize, received: usize, location: SourceLocation) -> Diagnostic {
203-
Diagnostic::new(
204-
format!(
205-
"Invalid parameter count. Received {received} parameters while {expected} parameters were expected.",
206-
)).with_error_code("E032")
207-
.with_location(location)
202+
pub fn invalid_argument_count(
203+
expected: usize,
204+
actual: usize,
205+
location: impl Into<SourceLocation>,
206+
) -> Diagnostic {
207+
Diagnostic::new(format!(
208+
"this POU takes {expected} argument(s) but {actual} argument(s) were supplied",
209+
))
210+
.with_error_code("E032")
211+
.with_location(location.into())
208212
}
209213

210214
pub fn unknown_type(type_name: &str, location: SourceLocation) -> Diagnostic {

0 commit comments

Comments
 (0)