瀏覽代碼

Fix: opaque types my only be defined in the CORRESPONDING implementation

ceriel 29 年之前
父節點
當前提交
15d2949b88
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lang/m2/comp/def.c

+ 2 - 1
lang/m2/comp/def.c

@@ -131,7 +131,8 @@ define(id, scope, kind)
 			/* An opaque type. We may now have found the
 			   definition of this type.
 			*/
-			if (kind == D_TYPE && !DefinitionModule) {
+			if (kind == D_TYPE && df->df_scope == CurrentScope &&
+			    !DefinitionModule) {
 				df->df_kind = D_TYPE;
 				return df;
 			}