diff --git a/src/func.c b/src/func.c index 459007c3b4e1..b8e62f46eb04 100644 --- a/src/func.c +++ b/src/func.c @@ -5174,9 +5174,6 @@ void UnitTestDeclaration::semantic(Scope *sc) return; } - if (inNonRoot()) - return; - if (global.params.useUnitTests) { if (!type) diff --git a/test/fail_compilation/ice14424.d b/test/fail_compilation/ice14424.d new file mode 100644 index 000000000000..ac4888789d64 --- /dev/null +++ b/test/fail_compilation/ice14424.d @@ -0,0 +1,13 @@ +// REQUIRED_ARGS: -o- -unittest +/* +TEST_OUTPUT: +--- +fail_compilation/ice14424.d(12): Error: tuple has no effect in expression (tuple(__unittestL3_1)) +--- +*/ + +void main() +{ + import imports.a14424; + __traits(getUnitTests, imports.a14424); +} diff --git a/test/fail_compilation/imports/a14424.d b/test/fail_compilation/imports/a14424.d new file mode 100644 index 000000000000..57312136d75c --- /dev/null +++ b/test/fail_compilation/imports/a14424.d @@ -0,0 +1,3 @@ +module imports.a14424; + +unittest { }