[Issue 21236] Associative array opApply is not nothrow
https://issues.dlang.org/show_bug.cgi?id=21236 Lionello Lunesu changed: What|Removed |Added CC||lio+bugzi...@lunesu.com --- Comment #1 from Lionello Lunesu --- This is problematic when trying to implement `toHash` for a type that has a nested AA. Without `nothrow` on `toHash` you get: source/value.d(481,13): Error: _aaApply2 is not nothrow With `nothrow` you get: source/value.d(461,12): Warning: toHash() must be declared as extern (D) size_t toHash() const nothrow @safe, not const pure @trusted ulong() --
[Issue 21388] C++ interop tests / Run (macOS-10.15, clang-7.0.0) (pull_request) Failing after 2m — Run (macOS-10.15, clang-7.0.0)
https://issues.dlang.org/show_bug.cgi?id=21388 Walter Bright changed: What|Removed |Added Keywords||TestSuite --
[Issue 21388] New: C++ interop tests / Run (macOS-10.15, clang-7.0.0) (pull_request) Failing after 2m — Run (macOS-10.15, clang-7.0.0)
https://issues.dlang.org/show_bug.cgi?id=21388 Issue ID: 21388 Summary: C++ interop tests / Run (macOS-10.15, clang-7.0.0) (pull_request) Failing after 2m — Run (macOS-10.15, clang-7.0.0) Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: bugzi...@digitalmars.com Log file: Run (macOS-10.15, clang-7.0.0) failed 7 minutes ago in 2m 47s Search logs 1m 4s 1m 43s Run dlang-community/setup-dlang@v1 Enabling dmd-2.091.0 Downloading http://downloads.dlang.org/releases/2.x/2.091.0/dmd.2.091.0.osx.tar.xz Verifying the download with GPG Error: connect ETIMEDOUT 52.218.193.131:80 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1129:14) { errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect', address: '52.218.193.131', port: 80 } Error: connect ETIMEDOUT 52.218.193.131:80 --
[Issue 21387] New: dmd.hdrgen - Wrong parent in pretty name for aggregate instantiated with lambda template
https://issues.dlang.org/show_bug.cgi?id=21387 Issue ID: 21387 Summary: dmd.hdrgen - Wrong parent in pretty name for aggregate instantiated with lambda template Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: ki...@gmx.net --- struct ChunkByImpl(alias pred) {} auto chunkBy(alias pred)() { return ChunkByImpl!pred(); } void main() { auto foo1 = () => chunkBy!((char a) => a == '_'); auto foo2 = () => chunkBy!((a) => a == '_'); import std.stdio; writeln("foo1: " , typeid(foo1()).name); writeln("foo2: " , typeid(foo2()).name); } --- Actual output: --- foo1: onlineapp.ChunkByImpl!(function (char a) pure nothrow @nogc @safe => cast(int)a == 95).ChunkByImpl foo2: onlineapp.main.__lambda2.ChunkByImpl!(__lambda1).ChunkByImpl --- Expected output for foo2: onlineapp.ChunkByImpl!(__lambda1).ChunkByImpl With QualifyTypes = true: onlineapp.ChunkByImpl!(onlineapp.main.__lambda2.__lambda1).ChunkByImpl --
[Issue 21337] join can iterates ranges multiple times
https://issues.dlang.org/show_bug.cgi?id=21337 --- Comment #3 from Dlang Bot --- dlang/phobos pull request #7692 "merge stable" was merged into master: - 10e862b458fe1b359ab050a08c8f4777a4c3cf7e by Richard Manthorpe: Fix Issue 21337: Join can iterate ranges multiple times https://github.com/dlang/phobos/pull/7692 --
[Issue 21346] core.stdcpp.vector.vector does not implement opEquals
https://issues.dlang.org/show_bug.cgi?id=21346 --- Comment #3 from Dlang Bot --- dlang/druntime pull request #3269 "merge stable" was merged into master: - 5c31195233480ed1c8a00ea4aaa1c50d042d4b49 by Nathan Sashihara: Fix Issue 21346 - core.stdcpp.vector.vector does not implement opEquals https://github.com/dlang/druntime/pull/3269 --
[Issue 21344] core.stdcpp.string.basic_string does not implement opEquals
https://issues.dlang.org/show_bug.cgi?id=21344 --- Comment #3 from Dlang Bot --- dlang/druntime pull request #3269 "merge stable" was merged into master: - 278daf49afdcd379ba2ebc81f0916ab42e8ef630 by Nathan Sashihara: Fix Issue 21344 - core.stdcpp.string.basic_string does not implement opEquals https://github.com/dlang/druntime/pull/3269 --
[Issue 21365] TypeInfo.swap must not allow reachable memory to be freed if interrupted by a garbage collection pass
https://issues.dlang.org/show_bug.cgi?id=21365 --- Comment #3 from Dlang Bot --- dlang/druntime pull request #3269 "merge stable" was merged into master: - e1b53449a9e44a3b63d61da172c37c2fd4aff1bb by Nathan Sashihara: Fix Issue 21365 - TypeInfo.swap must not allow reachable memory to be freed if interrupted by a garbage collection pass If the type might contain pointers perform the swap in pointer-sized chunks in case a garbage collection pass interrupts the function. Directly affected TypeInfo subclasses that were not overriding swap: - TypeInfo_AssociativeArray - TypeInfo_Class - TypeInfo_Delegate - TypeInfo_Interface - TypeInfo_Struct https://github.com/dlang/druntime/pull/3269 --
[Issue 21323] (64-bit Windows only) core.stdcpp.vector could not have core.stdcpp.vector as element
https://issues.dlang.org/show_bug.cgi?id=21323 --- Comment #3 from Dlang Bot --- dlang/druntime pull request #3269 "merge stable" was merged into master: - 444fc360b27adf4420464ab2019061f1c60b20fc by Nathan Sashihara: Fix Issue 21323 - (64-bit Windows only) core.stdcpp.vector could not have core.stdcpp.vector as element https://github.com/dlang/druntime/pull/3269 --
[Issue 21386] New: std.random.uniform!T(urng) when T is int/uint/long/ulong and urng.front is byte/ubyte/short/ushort is not supported but could be
https://issues.dlang.org/show_bug.cgi?id=21386 Issue ID: 21386 Summary: std.random.uniform!T(urng) when T is int/uint/long/ulong and urng.front is byte/ubyte/short/ushort is not supported but could be Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: phobos Assignee: nob...@puremagic.com Reporter: n8sh.second...@hotmail.com std.random.uniform!T(urng) when T is int/uint/long/ulong and urng.front is byte/ubyte/short/ushort is not supported but could be. A reasonable example of when urng.front might be a ubyte is a PRNG based on a stream cipher. --
[Issue 21385] New: std.random.uniform!T(urng) for integer T disregards urng.min and urng.max when producing the result so it may not actually be uniform
https://issues.dlang.org/show_bug.cgi?id=21385 Issue ID: 21385 Summary: std.random.uniform!T(urng) for integer T disregards urng.min and urng.max when producing the result so it may not actually be uniform Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nob...@puremagic.com Reporter: n8sh.second...@hotmail.com std.random.uniform!T(urng) for integer T disregards urng.min and urng.max when producing the result so it may not actually be uniform. This is not a problem for MersenneTwisterEngine or XorshiftEngine but it is a problem for LinearCongruentialEngine and potentially for user-defined generators. --
[Issue 21384] New: std.random.uniform!T() and std.random.uniform!T(urng) when T is dchar with any qualifiers can exceed dchar.max
https://issues.dlang.org/show_bug.cgi?id=21384 Issue ID: 21384 Summary: std.random.uniform!T() and std.random.uniform!T(urng) when T is dchar with any qualifiers can exceed dchar.max Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nob...@puremagic.com Reporter: n8sh.second...@hotmail.com std.random.uniform!T() and std.random.uniform!T(urng) when T is dchar with any qualifiers can exceed dchar.max Demonstration: --- void main() { import std.random : uniform, Xorshift32; auto rng = Xorshift32(123456789); const result = uniform!(const dchar)(rng); assert(result <= dchar.max); // Fails. } --- --
[Issue 21383] New: std.random.uniform!T(urng) when T is dchar disregards urng and always uses a thread-local random
https://issues.dlang.org/show_bug.cgi?id=21383 Issue ID: 21383 Summary: std.random.uniform!T(urng) when T is dchar disregards urng and always uses a thread-local random Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nob...@puremagic.com Reporter: n8sh.second...@hotmail.com std.random.uniform!T(urng) when T is dchar disregards urng and always uses a thread-local random Demonstration: --- void main() { // The following loop is unlikely to complete without an assertion failure: foreach (_; 0 .. 100) { import std.random : uniform, Xorshift32; auto rng0 = Xorshift32(123456789); auto rng1 = Xorshift32(123456789); assert(uniform!dchar(rng0) == uniform!dchar(rng1)); } } --- --
[Issue 21382] New: std.random.uniform!T(urng) when T is an integer type and urng.front is floating point is completely broken
https://issues.dlang.org/show_bug.cgi?id=21382 Issue ID: 21382 Summary: std.random.uniform!T(urng) when T is an integer type and urng.front is floating point is completely broken Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nob...@puremagic.com Reporter: n8sh.second...@hotmail.com std.random.uniform!T(urng) when T is an integer type and urng.front is floating point is completely broken std.random.uniform!T(urng) when T is an integer type and urng.front is floating point is completely broken. No predefined generators in std.random have floating point ElementType but user-defined generators might. Demonstration: --- void main() { import std.random : isUniformRNG, uniform; static bool isEveryResultZero(T,RNG)(ref RNG rng, size_t numTrials) { foreach (_; 0 .. numTrials) if (uniform!T(rng) != 0) return false; return true; } static struct Double01PRNG { enum bool isUniformRandom = true; enum double min = 0.0; enum double max = (ulong.max >>> (64 - 53)) * 0x1p-53; enum bool empty = false; ulong state; @property double front() const { auto result = (state >>> (64 - 53)) * 0x1p-53; assert(result >= 0 && result < 1); return result; } void popFront() { state = state * 2862933555777941757 + 1; } } static assert(isUniformRNG!Double01PRNG); // The following assertions pass but should not. auto double01PRNG = Double01PRNG(123456789); assert(isEveryResultZero!int(double01PRNG, 1_000_000)); assert(isEveryResultZero!uint(double01PRNG, 1_000_000)); assert(isEveryResultZero!long(double01PRNG, 1_000_000)); assert(isEveryResultZero!ulong(double01PRNG, 1_000_000)); } --- --
[Issue 21381] New: std.random.uniform!T(urng) when T is long or ulong and urng.front is signed int will be biased in its high bits
https://issues.dlang.org/show_bug.cgi?id=21381 Issue ID: 21381 Summary: std.random.uniform!T(urng) when T is long or ulong and urng.front is signed int will be biased in its high bits Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nob...@puremagic.com Reporter: n8sh.second...@hotmail.com std.random.uniform!T(urng) when T is long or ulong and urng.front is signed int will be biased in its high bits. No pseudorandom number generators defined in std.random produce signed integers but nothing in the function constraints or documentation advises library users against defining a custom PRNG that does. Demonstration: --- void main() { import std.random : isUniformRNG, uniform; import std.stdio : writefln; static struct SignedIntLCG { enum bool isUniformRandom = true; enum int min = int.min; enum int max = int.max; enum bool empty = false; int front; void popFront() { front = front * 0xac564b05 + 1; } } static assert(isUniformRNG!SignedIntLCG); // The higher bits of uniform!long(signedIntLCG) are biased towards // non-zero with increasing probability. The highest bit of // uniform!ulong(signedIntLCG) has a 75% chance of being non-zero. auto signedIntLCG = SignedIntLCG(123456789); size_t timesHighBitWas1 = 0; foreach (_; 0 .. 1_000_000) timesHighBitWas1 += uniform!ulong(signedIntLCG) >>> 63; writefln("%,d", timesHighBitWas1); // Outputs 750,158. } --- --
[Issue 21378] `pragma(inline)` should allow not only a bool literal but any CTFE expression that converts to bool
https://issues.dlang.org/show_bug.cgi?id=21378 --- Comment #1 from Dlang Bot --- @thewilsonator created dlang/dlang.org pull request #2879 "spec change for issue 21378 - Allow `pragma(inline, knownAtCTFE);`" mentioning this issue: - spec change for issue 21378 - Allow `pragma(inline, knownAtCTFE);` https://github.com/dlang/dlang.org/pull/2879 --
[Issue 21380] A case of compiler crash when using auto ref
https://issues.dlang.org/show_bug.cgi?id=21380 Basile-z changed: What|Removed |Added Summary|compiler crashes when using |A case of compiler crash |auto ref|when using auto ref --
[Issue 21379] UDA's implemented with functions and taking alias params don't compile
https://issues.dlang.org/show_bug.cgi?id=21379 --- Comment #2 from Daniel --- sorry, compiler was DMD v2.093.1 (with ldc2) --
[Issue 21380] compiler crashes when using auto ref
https://issues.dlang.org/show_bug.cgi?id=21380 --- Comment #2 from Daniel --- sorry, compiler was DMD v2.093.1 (with ldc2) --
[Issue 21380] compiler crashes when using auto ref
https://issues.dlang.org/show_bug.cgi?id=21380 Basile-z changed: What|Removed |Added Keywords||ice CC||b2.t...@gmx.com Hardware|x86_64 |All OS|Linux |All Severity|critical|regression --- Comment #1 from Basile-z --- regression from 2.073.2 (https://run.dlang.io/is/9fOvpM) w/o phobos: --- template isSomeFunction(T...) if (T.length == 1) { static if (is(typeof(& T[0]) U : U*) && is(U == function) || is(typeof(& T[0]) U == delegate)) { // T is a (nested) function symbol. enum bool isSomeFunction = true; } else static if (is(T[0] W) || is(typeof(T[0]) W)) { // T is an expression or a type. Take the type of it and examine. static if (is(W F : F*) && is(F == function)) enum bool isSomeFunction = true; // function pointer else enum bool isSomeFunction = is(W == function) || is(W == delegate); } else enum bool isSomeFunction = false; } struct MySerializer (T) { void serializeSinkType(T2) (scope auto ref T2 record) {} } template SupportSinkTypeSer(SerT) { enum SupportSinkTypeSer = isSomeFunction!(SerT.init.serializeSinkType!int); } int main() { enum x = SupportSinkTypeSer!(MySerializer!int); return 0; } --- --
[Issue 21379] UDA's implemented with functions and taking alias params don't compile
https://issues.dlang.org/show_bug.cgi?id=21379 Daniel changed: What|Removed |Added Severity|normal |major --- Comment #1 from Daniel --- DMD64 D Compiler v2.094.0 --
[Issue 21380] New: compiler crashes when using auto ref
https://issues.dlang.org/show_bug.cgi?id=21380 Issue ID: 21380 Summary: compiler crashes when using auto ref Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: critical Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: feco.grac...@gmail.com struct MySerializer (T) { void serializeSinkType(T2) (scope auto ref T2 record) {} } template SupportSinkTypeSer(SerT) { enum SupportSinkTypeSer = isSomeFunction!(SerT.init.serializeSinkType!int); } int main() { enum x = SupportSinkTypeSer!(MySerializer!int); return 0; } crashes compiler DMD64 D Compiler v2.094.0 with #0 0x7f28935b94ff llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x9814ff) #1 0x7f28935b7782 llvm::sys::RunSignalHandlers() (/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x97f782) #2 0x7f28935b9ac5 (/lib/x86_64-linux-gnu/libLLVM-10.so.1+0x981ac5) #3 0x7f28926d73c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0) #4 0x56251ebb125f _D3dmd10dinterpret13ctfeInterpretFCQBh10expression10ExpressionZQBd (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x3c425f) #5 0x56251ea5b7ef _D3dmd9dtemplate16TemplateInstance14semanticTiargsFKxSQCa7globals3LocPSQCr6dscope5ScopePSQDj4root5array__T5ArrayTCQEiQz10rootobject10RootObjectZQBmiZb (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x26e7ef) #6 0x56251eb81406 ExpressionSemanticVisitor::visit(ScopeExp*) (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x394406) #7 0x56251eb3fa80 _D3dmd7initsem9inferTypeFCQy4init11InitializerPSQBu6dscope5ScopeZ8visitExpMFCQCxQCa14ExpInitializerZQCx (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x352a80) #8 0x56251eb3f655 _D3dmd7initsem9inferTypeFCQy4init11InitializerPSQBu6dscope5ScopeZQBo (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x352655) #9 0x56251ebe1061 DsymbolSemanticVisitor::visit(VarDeclaration*) (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x3f4061) #10 0x56251ebdb132 _D3dmd9dtemplate16TemplateInstance13expandMembersMFPSQBz6dscope5ScopeZv (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x3ee132) #11 0x56251ebd1ec9 _D3dmd10dsymbolsem24templateInstanceSemanticFCQBs9dtemplate16TemplateInstancePSQCz6dscope5ScopePSQDr4root5array__T5ArrayTCQEq10expression10ExpressionZQBkZv (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x3e4ec9) #12 0x56251eb8146a ExpressionSemanticVisitor::visit(ScopeExp*) (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x39446a) #13 0x56251eb3fa80 _D3dmd7initsem9inferTypeFCQy4init11InitializerPSQBu6dscope5ScopeZ8visitExpMFCQCxQCa14ExpInitializerZQCx (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x352a80) #14 0x56251eb3f655 _D3dmd7initsem9inferTypeFCQy4init11InitializerPSQBu6dscope5ScopeZQBo (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x352655) #15 0x56251ebe1061 DsymbolSemanticVisitor::visit(VarDeclaration*) (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x3f4061) #16 0x56251eb8bd42 ExpressionSemanticVisitor::visit(DeclarationExp*) (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x39ed42) #17 0x56251ea668df StatementSemanticVisitor::visit(ExpStatement*) (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x2798df) #18 0x56251ea6729a StatementSemanticVisitor::visit(CompoundStatement*) (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x27a29a) #19 0x56251ea96f3a Semantic3Visitor::visit(FuncDeclaration*) (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x2a9f3a) #20 0x56251ea952cf Semantic3Visitor::visit(Module*) (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x2a82cf) #21 0x56251eb0c3fc mars_mainBody(Param&, Array&, Array&) (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x31f3fc) #22 0x56251ed4f1f2 cppmain() (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x5621f2) #23 0x7f289279f9dc _D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZv (/lib/x86_64-linux-gnu/libdruntime-ldc-shared.so.90+0xba9dc) #24 0x7f289279f7ef _d_run_main2 (/lib/x86_64-linux-gnu/libdruntime-ldc-shared.so.90+0xba7ef) #25 0x7f289279f65e _d_run_main (/lib/x86_64-linux-gnu/libdruntime-ldc-shared.so.90+0xba65e) #26 0x56251ea28535 main (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x23b535) #27 0x7f28921aa0b3 __libc_start_main /build/glibc-YYA7BZ/glibc-2.31/csu/../csu/libc-start.c:342:3 #28 0x56251ea2aabe _start (/home/dan/dev/thirdparty/install-ldc-latest/bin/ldc2+0x23dabe) Segmentation fault (core dumped) ldc2 failed with exit code 139. workaround is to remove the auto keyword, in that case it compiles... --
[Issue 21379] New: UDA's implemented with functions and taking alias params don't compile
https://issues.dlang.org/show_bug.cgi?id=21379 Issue ID: 21379 Summary: UDA's implemented with functions and taking alias params don't compile Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: feco.grac...@gmail.com public struct TestX(alias ST) { alias serializer = ST; } TestX!ST resultSerializer (alias ST) () { return TestX!ST(); } // this compiles, no problem @resultSerializer!(function (string){return "hello";})() void f () {} class X { // this one doesn't compile @resultSerializer!(function (string){return "hello";})() void f () {} } compiler error message for the UDA of X.f: function tests.X.resultSerializer!(function (string) { return "hello"; } ).resultSerializer need this to access member resultSerializer The workaround was to not use functions to implement UDA, but to create a class to implement it: public struct ResultSerializer(alias ST) { alias serializer = ST; } @ResultSerializer!(function (string){return "hello";})() void f () {} class X { @ResultSerializer!(function (string){return "hello";})() void f () {} } --
[Issue 21378] New: `pragma(inline)` should allow not only a bool literal but any CTFE expression that converts to bool
https://issues.dlang.org/show_bug.cgi?id=21378 Issue ID: 21378 Summary: `pragma(inline)` should allow not only a bool literal but any CTFE expression that converts to bool Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: b2.t...@gmx.com details in NG discussion : https://forum.dlang.org/post/htcqemkoacwyszads...@forum.dlang.org --