File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed
Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -16,17 +16,13 @@ jobs:
1616 - macOS-latest
1717 dc :
1818 - dmd-latest
19- - dmd-2.099.1
20- - dmd-2.098.1
19+ - dmd-2.101.2
2120 - ldc-latest
22- - ldc-1.29.0
23- - ldc-1.28.1
21+ - ldc-1.31.0
2422 exclude :
2523 # macOS requires DMD >= 2.107.1
2624 - os : macOS-latest
27- dc : dmd-2.099.1
28- - os : macOS-latest
29- dc : dmd-2.098.1
25+ dc : dmd-2.101.2
3026 runs-on : ${{ matrix.os }}
3127 steps :
3228 - name : Checkout repository
Original file line number Diff line number Diff line change 88 "license" : " BSL-1.0" ,
99
1010 "toolchainRequirements" : {
11- "frontend" : " >=2.098 "
11+ "frontend" : " >=2.101 "
1212 },
1313
1414 "dflags" : [" -preview=fieldwise" ],
Original file line number Diff line number Diff line change @@ -1729,7 +1729,7 @@ class MatchException : Exception
17291729template canMatch (alias handler, Ts... )
17301730 if (Ts.length > 0 )
17311731{
1732- enum canMatch = is (typeof ((ref Ts args) => handler(args)));
1732+ enum canMatch = is (typeof (auto ref (ref Ts args) => handler(args)));
17331733}
17341734
17351735// /
@@ -1752,6 +1752,20 @@ template canMatch(alias handler, Ts...)
17521752 assert (canMatch! (OverloadSet.fun, double ));
17531753}
17541754
1755+ // Allows returning non-copyable types by ref
1756+ // https://github.com/dlang/phobos/issues/10647
1757+ @safe unittest {
1758+ static struct NoCopy
1759+ {
1760+ @disable this (this );
1761+ }
1762+
1763+ static NoCopy lvalue;
1764+ static ref handler (int _) => lvalue;
1765+
1766+ assert (canMatch! (handler, int ));
1767+ }
1768+
17551769// Like aliasSeqOf!(iota(n)), but works in BetterC
17561770private template Iota (size_t n)
17571771{
You can’t perform that action at this time.
0 commit comments