Delphi TJSONPairEnumerator.GetCurrent 未展开
Delphi TJSONPairEnumerator.GetCurrent not expanded
我在 Delphi XE5 中构建项目后有提示:
[dcc32 Hint] unit.pas(140): H2443 Inline function 'TJSONPairEnumerator.GetCurrent' has not been expanded because unit 'Data.DBXPlatform' is not specified in USES list
指的是:
uses
System.Generics.Collections, Data.DBXJSON, System.IOUtils,
System.SysUtils, System.Classes;
...
var
wzorKlucz: string;
begin
enum := wzor.GetEnumerator;
while enum.MoveNext do
...
wzorKlucz := enum.Current.JsonString.Value; //here
...
如何禁用此行的提示,或者我的提示不正确?
正如提示所说,Data.DBXPlatform
不在您的 uses
列表中。只需在此处添加:
uses
System.Generics.Collections, Data.DBXJSON, System.IOUtils,
System.SysUtils, System.Classes,
Data.DBXPlatform;
This situation may occur if an inline function refers to a type in a
unit that is not explicitly used by the function's unit. For example,
this may happen if the function uses inherited to refer to methods
inherited from a distant ancestor, and that ancestor's unit is not
explicitly specified in the uses list of the function's unit.
If the inline function's code is to be expanded, then the unit that
calls the function must explicitly use the unit where the ancestor
type is exposed.
我在 Delphi XE5 中构建项目后有提示:
[dcc32 Hint] unit.pas(140): H2443 Inline function 'TJSONPairEnumerator.GetCurrent' has not been expanded because unit 'Data.DBXPlatform' is not specified in USES list
指的是:
uses
System.Generics.Collections, Data.DBXJSON, System.IOUtils,
System.SysUtils, System.Classes;
...
var
wzorKlucz: string;
begin
enum := wzor.GetEnumerator;
while enum.MoveNext do
...
wzorKlucz := enum.Current.JsonString.Value; //here
...
如何禁用此行的提示,或者我的提示不正确?
正如提示所说,Data.DBXPlatform
不在您的 uses
列表中。只需在此处添加:
uses
System.Generics.Collections, Data.DBXJSON, System.IOUtils,
System.SysUtils, System.Classes,
Data.DBXPlatform;
This situation may occur if an inline function refers to a type in a unit that is not explicitly used by the function's unit. For example, this may happen if the function uses inherited to refer to methods inherited from a distant ancestor, and that ancestor's unit is not explicitly specified in the uses list of the function's unit.
If the inline function's code is to be expanded, then the unit that calls the function must explicitly use the unit where the ancestor type is exposed.