mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 06:38:06 +02:00
codetools: allow anoynymous records, bug #18838
git-svn-id: trunk@29696 -
This commit is contained in:
parent
32f21a5927
commit
c66163d8f3
@ -4019,23 +4019,23 @@ begin
|
||||
// no ancestor class specified
|
||||
ClassIdentNode:=ClassNode.Parent;
|
||||
// check class name
|
||||
if (ClassIdentNode=nil)
|
||||
or (not (ClassIdentNode.Desc in [ctnTypeDefinition,ctnGenericType])) then
|
||||
if (ClassIdentNode<>nil)
|
||||
and (not (ClassIdentNode.Desc in [ctnTypeDefinition,ctnGenericType])) then
|
||||
begin
|
||||
MoveCursorToNodeStart(ClassNode);
|
||||
RaiseException('class without name');
|
||||
ClassIdentNode:=nil;
|
||||
end;
|
||||
if ClassNode.Desc=ctnClass then begin
|
||||
// if this class is not TObject, TObject is class ancestor
|
||||
SearchBaseClass:=not CompareSrcIdentifiers(ClassIdentNode.StartPos,'TObject');
|
||||
SearchBaseClass:=(ClassIdentNode=nil)
|
||||
or (not CompareSrcIdentifiers(ClassIdentNode.StartPos,'TObject'));
|
||||
end else if ClassNode.Desc in AllClassInterfaces then begin
|
||||
// Delphi has as default interface IInterface
|
||||
// FPC has as default interface IUnknown and an alias IInterface = IUnknown
|
||||
SearchBaseClass:=
|
||||
(not CompareSrcIdentifiers(ClassIdentNode.StartPos,'IInterface'))
|
||||
and (not CompareSrcIdentifiers(ClassIdentNode.StartPos,'IUnknown'));
|
||||
SearchBaseClass:=(ClassIdentNode=nil)
|
||||
or ((not CompareSrcIdentifiers(ClassIdentNode.StartPos,'IInterface'))
|
||||
and (not CompareSrcIdentifiers(ClassIdentNode.StartPos,'IUnknown')));
|
||||
end else
|
||||
exit;
|
||||
exit; // has no default ancestor (e.g. record)
|
||||
if not SearchBaseClass then exit;
|
||||
|
||||
{$IFDEF ShowTriedContexts}
|
||||
|
@ -1823,7 +1823,7 @@ begin
|
||||
fdfSearchInParentNodes,fdfSearchInAncestors];
|
||||
if IgnoreCurContext then
|
||||
Params.Flags:=Params.Flags+[fdfIgnoreCurContextNode];
|
||||
debugln(['TIdentCompletionTool.FindCollectionContext ',fdfIgnoreCurContextNode in Params.Flags]);
|
||||
//debugln(['TIdentCompletionTool.FindCollectionContext ',fdfIgnoreCurContextNode in Params.Flags]);
|
||||
ExprType:=FindExpressionTypeOfTerm(ContextExprStartPos,IdentStartPos,
|
||||
Params,false);
|
||||
//DebugLn(['TIdentCompletionTool.FindCollectionContext ',ExprTypeToString(ExprType)]);
|
||||
|
Loading…
Reference in New Issue
Block a user