Jelajahi Sumber

Take hierarchy into consideration. Fixes #489.

Brucey 5 tahun lalu
induk
melakukan
bba06cccab
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      stmt.bmx

+ 1 - 1
stmt.bmx

@@ -141,7 +141,7 @@ Type TAssignStmt Extends TStmt
 					If TFieldDecl(decl) Then
 						' check scope for ctor
 						Local scope:TFuncDecl = _env.FuncScope()
-						If Not scope Or Not scope.IsCtor() Or (decl.ClassScope() <> scope.ClassScope()) Then
+						If Not scope Or Not scope.IsCtor() Or (Not scope.ClassScope().ExtendsClass(decl.ClassScope())) Then
 							Err "Cannot modify ReadOnly field " + decl.ident
 						End If
 					Else