浏览代码

No Delete() for Struct.

Brucey 5 年之前
父节点
当前提交
49ee2dc4ef
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      decl.bmx

+ 7 - 2
decl.bmx

@@ -2056,8 +2056,13 @@ Type TFuncDecl Extends TBlockDecl
 			If retTypeExpr And Not TVoidType(retTypeExpr) Then
 				Err ident + "() cannot specify a return type"
 			End If
-			If ClassScope() And ClassScope().IsInterface() Then
-				Err ident + "() cannot be declared in an Interface."
+			Local sc:TClassDecl = ClassScope()
+			If sc Then
+				If sc.IsInterface() Then
+					Err ident + "() cannot be declared in an Interface."
+				Else If sc.IsStruct() And isDtor() Then
+					Err ident + "() cannot be declared in a Struct."
+				End If
 			End If
 			If IsCtor() retTypeExpr=New TObjectType.Create( TNewDecl(Self).cDecl )
 		End If