Jelajahi Sumber

Fixed New not exporting access attribute. Fixes #439
Improved ambiguity determination.

woollybah 6 tahun lalu
induk
melakukan
bdc203f9c2
3 mengubah file dengan 5 tambahan dan 5 penghapusan
  1. 1 1
      ctranslator.bmx
  2. 3 3
      decl.bmx
  3. 1 1
      translator.bmx

+ 1 - 1
ctranslator.bmx

@@ -5328,7 +5328,7 @@ End Rem
 		
 			If Not classDecl.templateSource Then
 
-				If Not (classDecl.attrs & CLASS_INTERFACE) And Not classDecl.IsStruct() Then
+				If Not (classDecl.attrs & CLASS_INTERFACE) And Not classDecl.IsStruct() And Not classHierarchyHasFunction(classDecl, "New") Then
 					Emit "-New()=" + Enquote("_" + classDecl.munged + "_New")
 				End If
 

+ 3 - 3
decl.bmx

@@ -1571,17 +1571,17 @@ End Rem
 						'match=func
 						matches.AddLast(func)
 						isexact=True
-						Exit
+						'Exit
 					EndIf
 				Else
-					If Not isexact
+					'If Not isexact
 						'If match 
 						'	_err="Unable to determine overload to use: "+match.ToString()+" or "+func.ToString()+"."
 						'Else
 							'match=func
 							matches.AddLast(func)
 						'EndIf
-					EndIf
+					'EndIf
 				EndIf
 				'Exit
 			Next

+ 1 - 1
translator.bmx

@@ -337,7 +337,7 @@ Type TTranslator
 	End Method
 
 	Method equalsIfcBuiltInFunc:Int(classDecl:TClassDecl, func:TFuncDecl, checked:Int = False)
-		If checked Or func.IdentLower() = "new" Or func.IdentLower() = "delete" Then
+		If checked Or func.IdentLower() = "delete" Then
 			If classDecl.munged = "bbObjectClass" Then
 				For Local decl:TFuncDecl = EachIn classDecl.Decls()
 					If Not decl.IsSemanted() Then