Erm... Why does this code work?

Monkey Forums/Monkey Beginners/Erm... Why does this code work?

Michiel(Posted 2015) [#1]
I'm having a really hard time with something that seems incredibly basic to do: implementing an interface. The code below works like a charm while I'm expecting it to fail horribly. I seem to be missing something, but I have no idea what...

This is the code that works while I thought it wouldn't:

Strict

Interface A
	Method pleaseImplementMe:Void()
End

Class B Implements A
	Method New()
		Print("B")
	End
End

Class C Implements A
	Method New()
		Print("C")
	End
End

Function Main:Int()
	Local b:B = New B()	
	Local c:C = New C()
	Return True
End



Pharmhaus(Posted 2015) [#2]
Please see here....


Michiel(Posted 2015) [#3]
Aha :) Thank you very much.