Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,29 @@ private ConstructorDeclarationSyntax createConstructor(XP.FoxclassContext contex
ctor.XGenerated = true;
}
}
else
{
// Subclass without its own INIT: VFP calls the parent's INIT
// with all the arguments passed to CREATEOBJECT(). Generate a
// Clipper-calling-convention constructor that forwards
// _ClipperArgs to the base class constructor, so the parent
// INIT receives the arguments instead of getting NIL/empty.
ParameterListSyntax pars = GetClipperParameters();
var arg = MakeArgument(GenerateSimpleName(XSharpSpecialNames.ClipperArgs));
ArgumentListSyntax args = MakeArgumentList(arg);
var chain = _syntaxFactory.ConstructorInitializer(SyntaxKind.BaseConstructorInitializer,
SyntaxFactory.ColonToken,
SyntaxFactory.MakeToken(SyntaxKind.BaseKeyword),
args
);
var mods = TokenList(SyntaxKind.PublicKeyword);
var id = context.Id.Get<SyntaxToken>();
GenerateAttributeList(attributeLists, SystemQualifiedNames.CompilerGenerated);
attributeLists.Add(MakeClipperCallingConventionAttribute(new List<ExpressionSyntax>()));
var body = MakeBlock(stmts);
ctor = _syntaxFactory.ConstructorDeclaration(attributeLists, mods, id, pars, chain, body, null, null);
ctor.XGenerated = true;
}
_pool.Free(attributeLists);
return ctor;
}
Expand Down
Loading