methods/bug774060.vala \
methods/bug775466.test \
methods/bug781061.vala \
+ methods/bug791215.vala \
methods/generics.vala \
methods/printf-invalid.test \
methods/printf-constructor.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 = StringLiteral.get_format_literal (last_arg);
if (format_literal == null && args.size == params.size - 1) {
// printf arguments
if (m.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 = StringLiteral.get_format_literal (last_arg);
if (format_literal == null && args.size == m.get_parameters ().size - 1) {