On Monday, 16 July 2012 at 17:02:52 UTC, Lemonfiend wrote:
[DMD32 D Compiler v2.059]

Hello,

I was rewriting some code so some large data array was a separate data file, and got an abnormal program termination, with the error:

C:\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(2704): Error: function std.conv.parse!(float[],string).parse compiler error, parameter 's', bugzilla 2962?
Assertion failure: '0' on line 717 in file 'glue.c'

I made a small testcase, and it didn't occur again.
So I made the testcase slightly bigger, by moving the parse function to a separate module, and it occurred again.

According to the bugzilla referenced in the error this was fixed; perhaps not?

-- main.d ---------------
module tuttmp.main;

import std.stdio;

import tuttmp.file;
import tuttmp.parser;

void main()
{
        writeln(fileString);

        parseImport();
}


-- parser.d ---------------
module tuttmp.parser;

import std.conv;
import std.stdio;

public void parseImport()
{
        writeln(fileString);

        auto fileArray = parse!(float[])(fileString);

        writeln(fileArray);
}


-- file.d ---------------
module tuttmp.file;

public string fileString = import("file.data");


-- file.data ---------------
[1,2,3]

Blast, minor edit mistake..

parser.d is supposed to be

module tuttmp.parser;

import std.conv;
import std.stdio;

import tuttmp.file;

public void parseImport()
{
        auto fileArray = parse!(float[])(fileString);

        writeln(fileArray);
}

Reply via email to