浏览代码

Fixed extension properties.

Mark Sibly 8 年之前
父节点
当前提交
e30e928a13
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/mx2cc/property.monkey2

+ 6 - 1
src/mx2cc/property.monkey2

@@ -68,7 +68,12 @@ Class PropertyList Extends FuncList
 	
 		If Not instance Throw New SemantEx( "Property '"+pdecl.ident+"' cannot be accessed without an instance" )
 		
-		If Not instance.type.ExtendsType( cscope.ctype )
+		Local selfType:=cscope.ctype
+		If pdecl.IsExtension selfType=selfType.superType
+		
+		If Not instance.type.ExtendsType( selfType )
+'			Print instance.type.ToString()
+'			Print cscope.ctype.ToString()
 			Throw New SemantEx( "Property '"+pdecl.ident+"' cannot be accessed from an instance of a different class" )
 		Endif