Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Templated TypeInfo #3174

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions posix.mak
Expand Up @@ -276,11 +276,10 @@ endif
.PHONY : unittest
ifeq (1,$(BUILD_WAS_SPECIFIED))
unittest : $(UT_MODULES) $(addsuffix /.run,$(ADDITIONAL_TESTS))
@echo done
else
unittest : unittest-debug unittest-release
unittest-%: target
$(MAKE) -f $(MAKEFILE) unittest OS=$(OS) MODEL=$(MODEL) DMD=$(DMD) BUILD=$*
$(MAKE) -s -f $(MAKEFILE) unittest OS=$(OS) MODEL=$(MODEL) DMD=$(DMD) BUILD=$*
andralex marked this conversation as resolved.
Show resolved Hide resolved
endif

ifeq ($(OS),linux)
Expand Down
7 changes: 6 additions & 1 deletion src/core/internal/dassert.d
Expand Up @@ -84,7 +84,12 @@ private string miniFormat(V)(const scope ref V v)
import core.stdc.stdio : sprintf;
import core.stdc.string : strlen;

static if (is(V == shared T, T))
static if (is(V E == enum))
{
const E base = v;
return miniFormat(base);
}
else static if (is(V == shared T, T))
{
// Use atomics to avoid race conditions whenever possible
static if (__traits(compiles, atomicLoad(v)))
Expand Down