2
0
Brucey 5 жил өмнө
parent
commit
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