codetools: fixed resolving dot after class, bug #28876

git-svn-id: trunk@50100 -
This commit is contained in:
mattias 2015-10-18 13:32:15 +00:00
parent 046db1ccaf
commit a5c1278946
4 changed files with 17 additions and 21 deletions

1
.gitattributes vendored
View File

@ -1015,6 +1015,7 @@ components/codetools/tests/laztests/bug28861_unit1.pas svneol=native#text/plain
components/codetools/tests/laztests/bug28861_unit2.pas svneol=native#text/plain
components/codetools/tests/laztests/bug28866_prg.pas svneol=native#text/plain
components/codetools/tests/laztests/bug28866_unit1.pas svneol=native#text/plain
components/codetools/tests/laztests/bug28876.pas svneol=native#text/plain
components/codetools/tests/laztests/tdefaultproperty1.pas svneol=native#text/plain
components/codetools/tests/parsertbase.pas svneol=native#text/plain
components/codetools/tests/parsertest.lpi svneol=native#text/plain

View File

@ -8235,7 +8235,7 @@ var
begin
aTool:=ExprType.Context.Tool;
{$IFDEF ShowExprEval}
debugln([' FindExpressionTypeOfTerm ResolveChildren used unit -> interface node ',dbgstr(ExprType.Context.Tool.ExtractNode(ExprType.Context.Node,[]))]);
debugln([' FindExpressionTypeOfTerm ResolveUseUnit used unit -> interface node ',dbgstr(ExprType.Context.Tool.ExtractNode(ExprType.Context.Node,[]))]);
{$ENDIF}
AnUnitName:=aTool.ExtractUsedUnitName(ExprType.Context.Node,@InFilename);
NewCodeTool:=aTool.FindCodeToolForUsedUnit(AnUnitName,InFilename,true);
@ -8283,9 +8283,7 @@ var
end
else if (ExprType.Context.Node.Desc=ctnClassOfType) then begin
// 'class of' => jump to the class
ExprType.Desc:=xtContext;
Params.Flags:=Params.Flags+[fdfFunctionResult,fdfFindChildren];
ExprType.Context.Node:=ExprType.Context.Node.FirstChild;
ExprType.Context:=ExprType.Context.Tool.FindBaseTypeOfNode(Params,ExprType.Context.Node.FirstChild);
end
else if (ExprType.Desc=xtContext)
and (ExprType.Context.Node.Desc=ctnPointerType)

View File

@ -40,7 +40,7 @@
<PackageName Value="fpcunitconsolerunner"/>
</Item2>
</RequiredPackages>
<Units Count="13">
<Units Count="9">
<Unit0>
<Filename Value="finddeclarationtest.lpr"/>
<IsPartOfProject Value="True"/>
@ -77,22 +77,6 @@
<Filename Value="fdt_with.pas"/>
<IsPartOfProject Value="True"/>
</Unit8>
<Unit9>
<Filename Value="fpctests/tdefaultproperty1.pas"/>
<IsPartOfProject Value="True"/>
</Unit9>
<Unit10>
<Filename Value="fpctests/README.txt"/>
<IsPartOfProject Value="True"/>
</Unit10>
<Unit11>
<Filename Value="laztests/bug28866_prg.pas"/>
<IsPartOfProject Value="True"/>
</Unit11>
<Unit12>
<Filename Value="laztests/bug28866_unit1.pas"/>
<IsPartOfProject Value="True"/>
</Unit12>
</Units>
</ProjectOptions>
<CompilerOptions>

View File

@ -0,0 +1,13 @@
program bug28876;
{$mode objfpc}{$H+}
uses
Classes;
Var
AClass : TClass;
begin
AClass := TObject;
AClass.ClassName{declaration:system.TObject.ClassName};
end.