This commit is contained in:
Michael Schimmel
2026-01-04 17:06:59 +01:00
parent 8914d59607
commit a4afae6f39
10 changed files with 655 additions and 211 deletions
+1 -1
View File
@@ -248,7 +248,7 @@ begin
raise ESpecializerException.CreateFmt('Internal Error: Failed to compile specialization for "%s"', [funcName]);
// 6b. Store in cache
var returnType := compiled.StaticType.Signatures[0].ReturnType;
var returnType := compiled.StaticType.AsMethod.Signatures[0].ReturnType;
specializedMethod := TSpecializedMethod.Create(compiled.Func, returnType, compiled.IsPure);
FMonomorphCache.Add(key, specializedMethod);
+11 -11
View File
@@ -542,7 +542,7 @@ begin
if not hasUnknownArgs then
begin
bestSig := nil;
for var sig in calleeType.Signatures do
for var sig in calleeType.AsMethod.Signatures do
begin
if Length(sig.ParamTypes) <> Length(argTypes) then
continue;
@@ -603,9 +603,9 @@ begin
elemType := TTypes.Unknown;
if baseType.Kind = stSeries then
elemType := baseType.ElementType
elemType := baseType.AsSeries.ElementType
else if baseType.Kind = stRecordSeries then
elemType := TTypes.CreateRecord(baseType.Definition);
elemType := TTypes.CreateRecord(baseType.AsRecord.Definition);
elemType := ApplyOptionality(elemType, isOpt);
Result := TAst.Indexer(Node.Identity, newBase, newIndex, elemType);
@@ -626,10 +626,10 @@ begin
if (baseType.Kind = stRecord) or (baseType.Kind = stRecordSeries) then
begin
idx := baseType.Definition.IndexOf(M.Member.Value);
idx := baseType.AsRecord.Definition.IndexOf(M.Member.Value);
if idx >= 0 then
begin
var fieldType := TTypes.FromScalarKind(baseType.Definition[idx]);
var fieldType := TTypes.FromScalarKind(baseType.AsRecord.Definition[idx]);
if baseType.Kind = stRecordSeries then
resType := TTypes.CreateSeries(fieldType)
else
@@ -768,7 +768,7 @@ begin
else if (sourceType.Kind = stRecordSeries) then
begin
// 2. Verify Selectors exist in Record Definition
var def := sourceType.Definition;
var def := sourceType.AsRecord.Definition;
for var sel in P.Selectors do
begin
if def.IndexOf(sel.Value) < 0 then
@@ -816,7 +816,7 @@ begin
if streamType.Kind = stRecordSeries then
begin
// Extract field type from definition
var def := streamType.Definition;
var def := streamType.AsRecord.Definition;
var idx := def.IndexOf(sel.Value);
if idx >= 0 then
inferredType := TTypes.FromScalarKind(def[idx]);
@@ -824,8 +824,8 @@ begin
else if streamType.Kind = stSeries then
begin
// If simple series, use its element type
if Assigned(streamType.ElementType) then
inferredType := streamType.ElementType
if Assigned(streamType.AsSeries.ElementType) then
inferredType := streamType.AsSeries.ElementType
else
inferredType := TTypes.Ordinal; // Fallback default
end;
@@ -879,13 +879,13 @@ begin
var typedLambda := Accept(preTypedLambda).AsLambdaExpression;
// 4. Infer Pipe Return Type & Validate Strictness
var lambdaRetType := typedLambda.AsTypedNode.StaticType.Signatures[0].ReturnType;
var lambdaRetType := typedLambda.AsTypedNode.StaticType.AsMethod.Signatures[0].ReturnType;
var pipeType: IStaticType;
if lambdaRetType.Kind = stRecord then
begin
// Valid: Record -> RecordSeries
pipeType := TTypes.CreateRecordSeries(lambdaRetType.Definition);
pipeType := TTypes.CreateRecordSeries(lambdaRetType.AsRecord.Definition);
end
else
begin
+1 -1
View File
@@ -446,7 +446,7 @@ begin
end;
end;
lambdaFunc := Visit(N.Transformation).AsMethod();
var outputDef := N.StaticType.Definition;
var outputDef := N.StaticType.AsRecord.Definition;
var pipeAdapter: TPipeStream.TPipeLambda :=
function(const S: array of ISeries; out R: array of TScalar.TValue): Boolean
var
-1
View File
@@ -588,7 +588,6 @@ var
predicateResult: TDataValue;
indexSeries: ISeries;
mapperFunc: TDataValue.TFunc;
finalSeries: ISeries;
begin
if Length(Args) <> 2 then
raise EArgumentException.Create('Where requires exactly two arguments: a series and a predicate function.');
+601 -180
View File
File diff suppressed because it is too large Load Diff