瀏覽代碼

Take hierarchy into consideration. Fixes #489.

Brucey 5 年之前
父節點
當前提交
bba06cccab
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      stmt.bmx

+ 1 - 1
stmt.bmx

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