diff test/interface1.d @ 113:27b9f749d9fe trunk

[svn r117] Initial working implementation of interfaces. Groundwork for all the different types of class/interface casts laid out.
author lindquist
date Sat, 24 Nov 2007 06:33:00 +0100
parents
children 44a95ac7368a
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/interface1.d	Sat Nov 24 06:33:00 2007 +0100
@@ -0,0 +1,22 @@
+module interface1;
+
+interface Inter
+{
+    void func();
+}
+
+class Class : Inter
+{
+    override void func()
+    {
+        printf("hello world\n");
+    }
+}
+
+void main()
+{
+    scope c = new Class;
+    c.func();
+    Inter i = c;
+    i.func();
+}