2
0
Эх сурвалжийг харах

Fixed null selfValue in FuncValue crash.

Mark Sibly 8 жил өмнө
parent
commit
8e449ff3a1

+ 4 - 2
src/mx2cc/func.monkey2

@@ -321,9 +321,11 @@ Class FuncValue Extends Value
 			
 			
 		Else If IsMethod
 		Else If IsMethod
 		
 		
-			If Not instance Throw New SemantEx( "Method '"+ToString()+"' cannot be accessed without an instance" )
+			If Not selfValue Throw New SemantEx( "Self has no type" )
 			
 			
-			If Not instance.type.ExtendsType( selfValue.type )'cscope.ctype )
+			If Not instance Throw New SemantEx( "Method '"+ToString()+"' cannot be accessed without an instance" )
+				
+			If Not instance.type.ExtendsType( selfValue.type )
 				Throw New SemantEx( "Method '"+ToString()+"' cannot be accessed from an instance of a different class" )
 				Throw New SemantEx( "Method '"+ToString()+"' cannot be accessed from an instance of a different class" )
 			Endif
 			Endif