Error: function declaration without return type.

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 6 13:16:35 PST 2015


class Test
{
	string mystring;

	this(string mystring)
	{
		this.mystring = mystring;
	}
	
	void foo()
	{
	writeln("test");
	writeln(mystring);
	}
	foo();
}

source\app.d(303): Error: function declaration without return 
type. (Note that c
onstructors are always named 'this')
source\app.d(303): Error: no identifier for declarator foo()
FAIL 
.dub\build\application-debug-windows-x86-dmd_2066-EF7A441AE01F652132F0A1ED8
B06EB48\ seismodownloader executable
Error executing command run: dmd failed with exit code 1.

What I am doing wrong?


More information about the Digitalmars-d-learn mailing list