From 64d0d3c9af28c88aaefa9b1e83720b839cc365e5 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Sat, 15 Aug 2026 11:53:20 +0100 Subject: [PATCH 1/4] [changelog] Improve IFTI with named arguments item --- changelog/dmd.named-args-ifti.dd | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/changelog/dmd.named-args-ifti.dd b/changelog/dmd.named-args-ifti.dd index 843b8a3bcc1c..11a8bbf6fc0f 100644 --- a/changelog/dmd.named-args-ifti.dd +++ b/changelog/dmd.named-args-ifti.dd @@ -1,7 +1,7 @@ -Implicit Function Template Instantiation (IFTI) handled named arguments better +Implicit Function Template Instantiation (IFTI) handles named arguments better -https://github.com/dlang/dmd/issues/21335 -https://github.com/dlang/dmd/issues/22878 +- +- When calling a function template with named arguments, parameters that are skipped (because their named argument was not provided) now correctly use @@ -16,7 +16,8 @@ void main() } --- -Named arguments that appear behind variadic arguments can now be assigned to: +Named function arguments can now be used when IFTI matches a preceding +template type sequence parameter: --- void error(T...)(T args, string file = __FILE__, int line = __LINE__) {} @@ -25,8 +26,10 @@ auto text(T...)(T args, Allocator alloc) {} void foo(Allocator gc) { - error("Code: ", code, file: __FILE__, line: __LINE__) + error("Code: ", code, file: __FILE__, line: __LINE__); return text("hello", "world", alloc: gc); } --- + +Above, `text` requires a named argument for `alloc` when using IFTI. From 07d8e208e608fe090863bd30419c44e238959069 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Sat, 15 Aug 2026 12:25:48 +0100 Subject: [PATCH 2/4] Various fixes --- changelog/dmd.cov-inline-pragma.dd | 2 +- changelog/dmd.deprecations.dd | 5 +++-- changelog/dmd.fastdfa.escapeanalysis.dd | 14 +++++++------- changelog/dmd.fastdfa.uninitialized.dd | 8 ++++---- changelog/dmd.monitor-field.dd | 2 +- changelog/dmd.nullderefcheck.dd | 4 ++-- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/changelog/dmd.cov-inline-pragma.dd b/changelog/dmd.cov-inline-pragma.dd index 04a5ba9a573f..d92b3c7cd4c2 100644 --- a/changelog/dmd.cov-inline-pragma.dd +++ b/changelog/dmd.cov-inline-pragma.dd @@ -11,4 +11,4 @@ inlined, so the function's lines correctly reflect how many times they were executed. Fixes $(LINK2 https://issues.dlang.org/show_bug.cgi?id=5848, Issue 5848) / -$(LINK2 https://github.com/dlang/dmd/issues/18337, #18337) +$(LINK2 https://github.com/dlang/dmd/issues/18337, #18337). diff --git a/changelog/dmd.deprecations.dd b/changelog/dmd.deprecations.dd index 6798828b357d..3aa55d601d2f 100644 --- a/changelog/dmd.deprecations.dd +++ b/changelog/dmd.deprecations.dd @@ -1,3 +1,4 @@ -Many deprections have been turned in errors +Many deprecations have been turned into errors -Using `return` statements in scope guards is now an error (in addition to contracts and `try...finally`) +Using `return` statements in the body of a scope guard is now an error +(in addition to use in `in/out` contract and `finally` blocks). diff --git a/changelog/dmd.fastdfa.escapeanalysis.dd b/changelog/dmd.fastdfa.escapeanalysis.dd index 57bd882cbee9..cab47570b0c0 100644 --- a/changelog/dmd.fastdfa.escapeanalysis.dd +++ b/changelog/dmd.fastdfa.escapeanalysis.dd @@ -1,11 +1,11 @@ The fast DFA engine has gained escape analysis capabilities -The engine works on the fundamental concept on "cells", a cell is a location in memory that holds something. -So a variable that is on the stack has a cell that provides it, but also may point to another cell if its typed as a pointer. +The engine works on the fundamental concept on "cells" - a cell is a location in memory that holds something. +So a variable that is on the stack has a cell that provides its storage, but also it may point to another cell if it is typed as a pointer. Due to the fast DFA engine not being able to model indirection, the cell of a variable and its containing pointer is considered separately from cells seen via indirection. This is particularly interesting with how by-ref parameters handle it. -The cell pointed at by the by-ref is the outer cell, even if its typed as a pointer. +The cell pointed at by the by-ref parameter is the outer cell, even if its typed as a pointer. ```d // Think of parameter as int* not int, so the outer cell is the container for the int. @@ -21,13 +21,13 @@ struct Animal { int* grabFromAnimal(scope Animal* animal) => animal.datem; ``` -Partial violations of ``scope`` is allowed in non-@safe functions. -Escaping via a throw statement will still error. +Partial violations of ``scope`` are allowed in non-@safe functions. +Escaping via a `throw` statement will still error. The first 29 parameters may be treated as outputs, all others must be inputs only. -This does not include the this pointer. +This does not include the `this` pointer. No attributes have been added at this time for users to use, you must rely solely on existing ones and inference. -Experimentally it may promote stack variables that are typed as a class to stack automatically. +Experimentally it may promote stack variables that are typed as a class to the stack automatically. This may be disabled in the future if it is shown to cause problems. diff --git a/changelog/dmd.fastdfa.uninitialized.dd b/changelog/dmd.fastdfa.uninitialized.dd index 2d830b71306d..600fd39f8c76 100644 --- a/changelog/dmd.fastdfa.uninitialized.dd +++ b/changelog/dmd.fastdfa.uninitialized.dd @@ -13,7 +13,7 @@ void readFromUninit() @system } ``` -As part of this it is now capable of looking through pointers and seeing properties of variables that are on the stack. +As part of this, it is now capable of looking through pointers and seeing properties of variables that are on the stack. An application of this feature is the prevention of mathematical operators from accessing default initialized floating point types. @@ -30,7 +30,7 @@ void checkFloatInit(bool condition) } ``` -It will not activate for other expressions, or statements. -Only in a mathematical expression. +It will not activate for other expressions, or statements - +only in a mathematical expression. -This was not originally part of the fast DFA engines scope, its continued existence depends upon community feedback as part of usage. +This was not originally part of the fast DFA engines scope. Its continued existence depends upon community feedback as part of usage. diff --git a/changelog/dmd.monitor-field.dd b/changelog/dmd.monitor-field.dd index f6799affa4dc..1d082c80f820 100644 --- a/changelog/dmd.monitor-field.dd +++ b/changelog/dmd.monitor-field.dd @@ -1,6 +1,6 @@ The `Object.__monitor` field has been moved to druntime -This field was previously hard coded into the compiler, and is used as a mutex for `synchronized(obj)` blocks. +This field was previously hard-coded into the compiler, and is used as a mutex for `synchronized(obj)` blocks. By declaring it explicitly in druntime's `Object`, custom druntimes can now omit it entirely, saving 8 bytes per class instance when `synchronized` is not needed. The field is treated specially by the compiler and remains excluded from: diff --git a/changelog/dmd.nullderefcheck.dd b/changelog/dmd.nullderefcheck.dd index ebac2a7c44ab..6d5f8f02c4de 100644 --- a/changelog/dmd.nullderefcheck.dd +++ b/changelog/dmd.nullderefcheck.dd @@ -2,9 +2,9 @@ Checks for null dereferences A new check has been implemented that injects code to check a pointer for null before it is dereferenced. -It will be typically be used if you need a backtrace generated or you want to catch and handle the `Error` as part of a scheduler. +It will typically be used if you need a backtrace generated or you want to catch and handle the `Error` as part of a scheduler. -This can be enabled for all functions by using `-check=nullderef=on` or exclusively for `@safe` functions with `-check=nullderef=safeonly` +This can be enabled for all functions by using `-check=nullderef=on` or exclusively for `@safe` functions with `-check=nullderef=safeonly`. By default it is off. What happens may be customized by the `-checkaction` switch and by setting a new handler in `core.exception`. From 7d33eeb59c8618764b2e780cd5196c93dab75ed9 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Sat, 15 Aug 2026 12:26:34 +0100 Subject: [PATCH 3/4] [tuple unpacking] Add function literal example From https://blog.dlang.org/2026/04/12/dip-1053-a-tale-of-tuples/#4-unpacking-function-literal-parameters. --- changelog/dmd.tuple-unpacking.dd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog/dmd.tuple-unpacking.dd b/changelog/dmd.tuple-unpacking.dd index 7f92dfb062f0..3bd63024c74f 100644 --- a/changelog/dmd.tuple-unpacking.dd +++ b/changelog/dmd.tuple-unpacking.dd @@ -7,6 +7,7 @@ It allows extracting multiple values from a tuple or compile-time sequence direc ------- // Requires -preview=tuples +import std.stdio : writeln; import std.typecons : tuple; void main() @@ -24,6 +25,9 @@ void main() { // ... } + // Unpacking works in a function literal parameter list + alias dg = ((x, y), z) => writeln(x, " ", y, " ", z); + dg(tuple(1, 2), 3); // "1 2 3\n" } ------- From ab82326fe1d5e6205f98fba9520d76b4ff111e69 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Sat, 15 Aug 2026 12:59:48 +0100 Subject: [PATCH 4/4] Only `scope(failure)` return was made an error --- changelog/dmd.deprecations.dd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog/dmd.deprecations.dd b/changelog/dmd.deprecations.dd index 3aa55d601d2f..76e568cbbd9b 100644 --- a/changelog/dmd.deprecations.dd +++ b/changelog/dmd.deprecations.dd @@ -1,4 +1,4 @@ Many deprecations have been turned into errors -Using `return` statements in the body of a scope guard is now an error -(in addition to use in `in/out` contract and `finally` blocks). +Using `return` statements in the body of a `scope(failure)` guard is now an error +(in addition to use in other scope guards, `in/out` contract and `finally` blocks).