Merge: mnit: Fix error on refined virtual types
authorJean Privat <jean@pryen.org>
Tue, 13 Oct 2015 16:29:59 +0000 (12:29 -0400)
committerJean Privat <jean@pryen.org>
Tue, 13 Oct 2015 16:29:59 +0000 (12:29 -0400)
Simple fix for the "Redef Error" in mnit clients: do not redef virtual types, instead assert the types in the users methods.

Pull-Request: #1751
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Jean Privat <jean@pryen.org>

lib/mnit/android/android_app.nit
lib/mnit/linux/linux_app.nit
tests/sav/ballz_linux.res [deleted file]
tests/sav/dino_linux.res [deleted file]
tests/sav/shoot_linux.res [deleted file]

index 61af9df..c8f02e3 100644 (file)
@@ -37,8 +37,6 @@ in "C" `{
 `}
 
 redef class App
-       redef type D: Opengles1Display
-
        redef fun init_window
        do
                display = new Opengles1Display
index 7bc03a0..c191a60 100644 (file)
@@ -26,9 +26,6 @@ in "C" `{
 `}
 
 redef class App
-       redef type D: Opengles1Display
-       redef type I: Opengles1Image
-
        redef fun setup
        do
                if "NIT_TESTING".environ == "true" then exit 0
@@ -39,8 +36,11 @@ redef class App
 
        redef fun generate_input
        do
+               var display = display
+               assert display isa Opengles1Display
+
                for event in display.sdl_display.events do
-                       input( event )
+                       input event
                end
        end
 end
diff --git a/tests/sav/ballz_linux.res b/tests/sav/ballz_linux.res
deleted file mode 100644 (file)
index 18bfeab..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-../lib/mnit/linux/linux_app.nit:29,16--31: Redef Error: a virtual type cannot be refined.
-../lib/mnit/linux/linux_app.nit:30,16--29: Redef Error: a virtual type cannot be refined.
diff --git a/tests/sav/dino_linux.res b/tests/sav/dino_linux.res
deleted file mode 100644 (file)
index 18bfeab..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-../lib/mnit/linux/linux_app.nit:29,16--31: Redef Error: a virtual type cannot be refined.
-../lib/mnit/linux/linux_app.nit:30,16--29: Redef Error: a virtual type cannot be refined.
diff --git a/tests/sav/shoot_linux.res b/tests/sav/shoot_linux.res
deleted file mode 100644 (file)
index 18bfeab..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-../lib/mnit/linux/linux_app.nit:29,16--31: Redef Error: a virtual type cannot be refined.
-../lib/mnit/linux/linux_app.nit:30,16--29: Redef Error: a virtual type cannot be refined.