D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11441 - DMD halts compilation at semantic3
Summary: DMD halts compilation at semantic3
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All Linux
: P2 regression
Assignee: No Owner
URL:
Keywords: ice, industry
Depends on:
Blocks:
 
Reported: 2013-11-04 12:18 UTC by Jonathan Crapuchettes
Modified: 2013-11-15 19:09 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jonathan Crapuchettes 2013-11-04 12:18:46 UTC
Simple example fails to finish compiling with git HEAD, but works with 2.063.2. If the canFind is removed, the code will compile.

Code
---
import std.algorithm;

enum Test : byte { None = -1, A, B }

void main()
{
    Test[] a = [Test.B, Test.A];
    a.canFind(Test.A);
}

Output
---
binary    /home/jonathan/dmd-git/build/bin/dmd
version   v2.064-devel-d6a0fb8
config    /home/jonathan/dmd-git/build/bin/dmd.conf
parse     test
importall test
import    object	(/home/jonathan/dmd-git/build/include/object.di)
import    std.algorithm	(/home/jonathan/dmd-git/build/include/std/algorithm.d)
import    std.c.string	(/home/jonathan/dmd-git/build/include/std/c/string.d)
import    core.stdc.string	(/home/jonathan/dmd-git/build/include/core/stdc/string.d)
import    core.stdc.stddef	(/home/jonathan/dmd-git/build/include/core/stdc/stddef.d)
import    core.bitop	(/home/jonathan/dmd-git/build/include/core/bitop.d)
import    std.array	(/home/jonathan/dmd-git/build/include/std/array.d)
import    core.memory	(/home/jonathan/dmd-git/build/include/core/memory.d)
import    std.ascii	(/home/jonathan/dmd-git/build/include/std/ascii.d)
import    std.conv	(/home/jonathan/dmd-git/build/include/std/conv.d)
import    std.math	(/home/jonathan/dmd-git/build/include/std/math.d)
import    core.stdc.math	(/home/jonathan/dmd-git/build/include/core/stdc/math.d)
import    core.stdc.config	(/home/jonathan/dmd-git/build/include/core/stdc/config.d)
import    std.range	(/home/jonathan/dmd-git/build/include/std/range.d)
import    core.exception	(/home/jonathan/dmd-git/build/include/core/exception.d)
import    core.stdc.stdio	(/home/jonathan/dmd-git/build/include/core/stdc/stdio.d)
import    core.stdc.stdarg	(/home/jonathan/dmd-git/build/include/core/stdc/stdarg.d)
import    std.exception	(/home/jonathan/dmd-git/build/include/std/exception.d)
import    std.string	(/home/jonathan/dmd-git/build/include/std/string.d)
import    core.vararg	(/home/jonathan/dmd-git/build/include/core/vararg.d)
import    core.stdc.stdlib	(/home/jonathan/dmd-git/build/include/core/stdc/stdlib.d)
import    std.format	(/home/jonathan/dmd-git/build/include/std/format.d)
import    std.bitmanip	(/home/jonathan/dmd-git/build/include/std/bitmanip.d)
import    std.system	(/home/jonathan/dmd-git/build/include/std/system.d)
import    std.traits	(/home/jonathan/dmd-git/build/include/std/traits.d)
import    std.typetuple	(/home/jonathan/dmd-git/build/include/std/typetuple.d)
import    std.typecons	(/home/jonathan/dmd-git/build/include/std/typecons.d)
import    std.utf	(/home/jonathan/dmd-git/build/include/std/utf.d)
import    std.functional	(/home/jonathan/dmd-git/build/include/std/functional.d)
import    std.uni	(/home/jonathan/dmd-git/build/include/std/uni.d)
import    std.internal.unicode_tables	(/home/jonathan/dmd-git/build/include/std/internal/unicode_tables.d)
import    core.stdc.errno	(/home/jonathan/dmd-git/build/include/core/stdc/errno.d)
import    std.container	(/home/jonathan/dmd-git/build/include/std/container.d)
import    std.random	(/home/jonathan/dmd-git/build/include/std/random.d)
import    std.c.time	(/home/jonathan/dmd-git/build/include/std/c/time.d)
import    core.stdc.time	(/home/jonathan/dmd-git/build/include/core/stdc/time.d)
import    std.numeric	(/home/jonathan/dmd-git/build/include/std/numeric.d)
import    std.c.stdlib	(/home/jonathan/dmd-git/build/include/std/c/stdlib.d)
import    std.complex	(/home/jonathan/dmd-git/build/include/std/complex.d)
import    core.thread	(/home/jonathan/dmd-git/build/include/core/thread.di)
import    core.time	(/home/jonathan/dmd-git/build/include/core/time.d)
import    core.sys.posix.time	(/home/jonathan/dmd-git/build/include/core/sys/posix/time.d)
import    core.sys.posix.config	(/home/jonathan/dmd-git/build/include/core/sys/posix/config.d)
import    core.sys.posix.sys.types	(/home/jonathan/dmd-git/build/include/core/sys/posix/sys/types.d)
import    core.stdc.stdint	(/home/jonathan/dmd-git/build/include/core/stdc/stdint.d)
import    core.stdc.signal	(/home/jonathan/dmd-git/build/include/core/stdc/signal.d)
import    core.stdc.wchar_	(/home/jonathan/dmd-git/build/include/core/stdc/wchar_.d)
import    core.sys.posix.signal	(/home/jonathan/dmd-git/build/include/core/sys/posix/signal.d)
import    core.sys.posix.sys.time	(/home/jonathan/dmd-git/build/include/core/sys/posix/sys/time.d)
import    core.sys.posix.sys.select	(/home/jonathan/dmd-git/build/include/core/sys/posix/sys/select.d)
import    core.sys.posix.unistd	(/home/jonathan/dmd-git/build/include/core/sys/posix/unistd.d)
import    core.sys.posix.inttypes	(/home/jonathan/dmd-git/build/include/core/sys/posix/inttypes.d)
import    core.stdc.inttypes	(/home/jonathan/dmd-git/build/include/core/stdc/inttypes.d)
semantic  test
import    core.sys.posix.pthread	(/home/jonathan/dmd-git/build/include/core/sys/posix/pthread.d)
import    core.sys.posix.sched	(/home/jonathan/dmd-git/build/include/core/sys/posix/sched.d)
entry     main      	test.d
semantic2 test
semantic3 test
Comment 1 Jonathan Crapuchettes 2013-11-04 13:36:08 UTC
I found this bug while trying to find a reduced test case for canFind returning false when it should have been returning true.
Comment 2 kekeniro2 2013-11-06 01:11:39 UTC
I hit this case but got an error message below on Windows 7.

c:\d\dmd2\windows\bin\..\..\src\phobos\std\algorithm.d(3724): Error: template instance std.traits.isSomeChar!(Type) recursive expansion

It occurs in 'find' function. The line at line 3724 is:
enum  isIntegralNeedle = isSomeChar!E || isIntegral!E || isBoolean!E;


Information Only.
Comment 3 Martin Nowak 2013-11-14 17:57:11 UTC
This seems to be fixed since https://github.com/D-Programming-Language/dmd/commit/569908d3cc51ebf07260811929add6dcb79fef3e but it might just be a side-effect of the merged bugfix.
The compiler runs into an infinite recursion in FuncDeclaration::overloadInsert.