Преглед изворни кода

Added test for inheritance over multiple files

- this test checks if the compiler processes multiple imports of the same file correctly + inheritance done in this files
Ronny Otto пре 11 година
родитељ
комит
5524cb936b

+ 13 - 0
tests/framework/language/inheritance_01.bmx

@@ -0,0 +1,13 @@
+SuperStrict
+Framework Brl.StandardIO
+
+'this "queue" import IS NOT NEEDED because it gets imported by
+'"extend" already. BUT : if you import "queue" you check if the
+'information is correctly processed by the compiler.
+
+Import "inheritance_01.queue.bmx"
+Import "inheritance_01.extend.bmx"
+
+local queue:MyTypeQueue = new MyTypeQueue
+
+queue.insert(new MyOtherType)

+ 8 - 0
tests/framework/language/inheritance_01.extend.bmx

@@ -0,0 +1,8 @@
+SuperStrict
+'Import Brl.StandardIO
+Import "inheritance_01.queue.bmx"
+
+Type MyOtherType extends MyType
+	field myOthervar:int
+End Type
+

+ 17 - 0
tests/framework/language/inheritance_01.queue.bmx

@@ -0,0 +1,17 @@
+SuperStrict
+Import Brl.StandardIO
+
+
+Type MyTypeQueue
+	Field _content:MyType[]
+
+	Method Insert:int(obj:MyType)
+		_content :+ [obj]
+		print "added"
+	End Method
+End Type
+
+
+Type MyType
+	Field myOthervar:int
+End Type

+ 1 - 0
tests/framework/language/inheritance_01.res

@@ -0,0 +1 @@
+compiled