changeset 242:c69c59de5477

double alias and "need 'this'" Thomas Kuehne <thomas@kuehne.thisisspam.cn> 2005-01-22 news:csu1gv$see$1@digitaldaemon.com nntp://news.digitalmars.com/digitalmars.D.bugs/2737
author thomask
date Sat, 22 Jan 2005 17:14:08 +0000
parents 1268141c5b17
children 7c8580d800ab
files run/alias_13.d run/alias_14.d
diffstat 2 files changed, 79 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/alias_13.d	Sat Jan 22 17:14:08 2005 +0000
@@ -0,0 +1,40 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Thomas Kuehne <thomas@kuehne.thisisspam.cn>
+// @date@	2005-01-22
+// @uri@	news:csu1gv$see$1@digitaldaemon.com
+// @url@	nntp://news.digitalmars.com/digitalmars.D.bugs/2737
+
+module dstress.run.alias_13;
+
+int status;
+
+class Check{
+	void sum(byte[] b){
+		status++;
+	}
+
+	void add(byte b){
+		assert(0);
+	}	
+
+	alias sum write;
+	alias add write;
+	
+	void test(){
+		byte[] buffer;
+		write(buffer);
+	}
+}
+
+
+int main(){
+	Check c = new Check();
+	status=0;
+	assert(status==0);
+	c.test();
+	assert(status==1);
+	return 0;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/alias_14.d	Sat Jan 22 17:14:08 2005 +0000
@@ -0,0 +1,39 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Thomas Kuehne <thomas@kuehne.thisisspam.cn>
+// @date@	2005-01-22
+// @uri@	news:csu1gv$see$1@digitaldaemon.com
+// @url@	nntp://news.digitalmars.com/digitalmars.D.bugs/2737
+
+module dstress.run.alias_14;
+
+int status;
+
+class Check{
+	void sum(byte[] b){
+		status++;
+	}
+
+	void add(byte b){
+		assert(0);
+	}	
+
+	alias sum write;
+	
+	void test(){
+		byte[] buffer;
+		write(buffer);
+	}
+}
+
+
+int main(){
+	Check c = new Check();
+	status=0;
+	assert(status==0);
+	c.test();
+	assert(status==1);
+	return 0;
+}
\ No newline at end of file