www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Internal error: ../ztc/cgcs.c

reply "Namespace" <rswhite4 googlemail.com> writes:
----
import std.stdio;

int[2] getSize() {
	return [42, 23];
}

int width() {
	return getSize()[0];
}

void main()
{
	writeln("Hello world!");
}
----

Compilation output:
Internal error: ../ztc/cgcs.c 343

http://dpaste.1azy.net/a1897e84

I don't know if this should compile (but I think so) or if the 
error message is a bit ... in need of improvement.
Thoughts?
Apr 24 2013
next sibling parent Timon Gehr <timon.gehr gmx.ch> writes:
On 04/24/2013 10:25 PM, Namespace wrote:
 ----
 import std.stdio;

 int[2] getSize() {
      return [42, 23];
 }

 int width() {
      return getSize()[0];
 }

 void main()
 {
      writeln("Hello world!");
 }
 ----

 Compilation output:
 Internal error: ../ztc/cgcs.c 343

 http://dpaste.1azy.net/a1897e84

 I don't know if this should compile (but I think so) or if the error
 message is a bit ... in need of improvement.
 Thoughts?
An "Internal error" is always a compiler bug. http://d.puremagic.com/issues/enter_bug.cgi
Apr 24 2013
prev sibling parent reply "bearophile" <bearophileHUGS lycos.com> writes:
Namespace:

 import std.stdio;

 int[2] getSize() {
 	return [42, 23];
 }

 int width() {
 	return getSize()[0];
 }

 void main()
 {
 	writeln("Hello world!");
 }
 ----

 Compilation output:
 Internal error: ../ztc/cgcs.c 343
I think this is already fixed in the current dmd 2.063alpha. Bye, bearophile
Apr 24 2013
parent "Namespace" <rswhite4 googlemail.com> writes:
 I think this is already fixed in the current dmd 2.063alpha.

 Bye,
 bearophile
You walking encyclopedia. ;) Good to know.
Apr 24 2013