D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6071 - BigInt initialization causes compiler to hang
Summary: BigInt initialization causes compiler to hang
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-28 19:42 UTC by Paul D. Anderson
Modified: 2011-08-30 21:12 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Paul D. Anderson 2011-05-28 19:42:52 UTC
The following code compiles:

import std.bigint;
import std.stdio;

public static void main() {
	writeln("Hello, world!");
	BigInt big = BigInt(0);
}

But this code causes the compiler to enter an endless loop:

import std.bigint;
import std.stdio;

public BigInt big = BigInt(0);

public static void main() {
	writeln("Hello, world!");
}

This seems to be generally true for any initialization of a BigInt variable outside a function.

Using dmd -v, with source code in bigtest.d, it hangs at "semantic2 bigtest".
Comment 1 Paul D. Anderson 2011-08-30 21:12:48 UTC
The subject code works correctly in DMD 2.054.