Three legitimate bugs? (D1.061)

strtr strtr at spam.com
Sat May 15 13:15:23 PDT 2010


Should I report these bugs?
(and how should I call this first one?)
----
module main;
//const S S1 = S(); // uncomment this to compile
struct S
{
  float value;
  static S opCall()
  {
    S s;
    return s;
  }
  const S S2 = S();
}
void main(){}
--
main.d(4): Error: struct main.S no size yet for forward reference
main.d(4): Error: struct main.S no size yet for forward reference
main.d(11): Error: cannot evaluate opCall() at compile time
----

----
module main;
import t_def;
class C{ mixin T!(); }
void main(){
	C c = new C();
	c.func();
}
--
module t_def;

template T()
{
	int[] arr;
	public void func()
	{
		arr[1] = 42;
	}
}
--
run main.exe
Error: ArrayBoundsError main.d(8)
should be t_def.d(8)
----

----
module main;

const S S1 = S();

struct S
{
  static S func( S s_ )
  out(result){ assert(false,random); }
  body{ return s_; }

  const S S2 = func(S());
}
void main(){}
--
main.d(8): Error: __error <---# should be assert failure #
main.d(11): Error: cannot evaluate func((S())) at compile time
----


More information about the Digitalmars-d-learn mailing list