https://bugzilla.gnome.org/show_bug.cgi?id=791215
methods/bug737222.vala \
methods/bug743877.vala \
methods/bug771964.vala \
+ methods/bug791215.vala \
methods/generics.vala \
control-flow/break.vala \
control-flow/expressions-conditional.vala \
--- /dev/null
+[PrintfFormat]
+void foo_print (string? fmt, ...) {
+ assert (fmt == null);
+}
+
+void main () {
+ foo_print (null);
+}
// printf arguments
if (mtype is MethodType && ((MethodType) mtype).method_symbol.printf_format) {
StringLiteral format_literal = null;
- if (last_arg != null) {
+ if (last_arg is NullLiteral) {
+ // do not replace explicit null
+ } else if (last_arg != null) {
// use last argument as format string
format_literal = last_arg as StringLiteral;
if (format_literal == null && args.size == params.size - 1) {