diff nocompile/overload_14.d @ 316:bebf25858c08

updated testcases to DMD version 0.118
author thomask
date Thu, 17 Mar 2005 15:00:16 +0000
parents
children f87ba6507260
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/overload_14.d	Thu Mar 17 15:00:16 2005 +0000
@@ -0,0 +1,43 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Nick Sabalausky <z@a.a>
+// @date@	2005-02-01
+// @uri@	news:ctpknf$21se$1@digitaldaemon.com
+// @url@	nntp://news.digitmars.com/digitalmars.D.bugs
+
+// name resolution happens before overload resolution
+
+module dstress.run.overload_14;
+
+int status;
+
+void check(int x){
+	status++;
+}
+
+class MyClass{
+	void test(){
+		assert(status==0);
+		check(0);
+		assert(status==1);
+		check();
+		assert(status==3);
+	}
+
+	void check(){
+		assert(status==1);
+		status+=2;
+	}
+}
+
+int main(){
+	MyClass c = new MyClass();
+	assert(status==0);
+	c.test();
+	assert(status==3);
+	check(0);
+	assert(status==4);
+	return 0;
+}