Ver código fonte

Deprecate New object usage. Fixes #342.

woollybah 7 anos atrás
pai
commit
52ae279197
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      expr.bmx

+ 3 - 0
expr.bmx

@@ -855,8 +855,11 @@ Type TNewObjectExpr Extends TExpr
 			' maybe it's an instance of a type ?
 			' maybe it's an instance of a type ?
 			Local decl:TVarDecl = TVarDecl(_env.FindDecl(it.ident))
 			Local decl:TVarDecl = TVarDecl(_env.FindDecl(it.ident))
 			If decl And TObjectType(decl.ty) Then
 			If decl And TObjectType(decl.ty) Then
+				' this legacy feature is deprecated. Issue a warning but let it go for now...
 				ty = decl.ty
 				ty = decl.ty
 				instanceExpr = New TVarExpr.Create(decl).Semant()
 				instanceExpr = New TVarExpr.Create(decl).Semant()
+				' 
+				Warn("Use of New <Object instance> is deprecated, and support will be removed in a future update.")
 			Else
 			Else
 				Err "Type '"+it.ident+"' not found"
 				Err "Type '"+it.ident+"' not found"
 			End If
 			End If