Immutable infered types

This commit is contained in:
Michael Schimmel
2025-11-04 22:10:11 +01:00
parent f73c0c67b8
commit 980919525b
6 changed files with 395 additions and 271 deletions
+12 -2
View File
@@ -7,7 +7,8 @@ uses
System.Generics.Collections,
Myc.Data.Scalar,
Myc.Data.Value,
Myc.Data.Keyword;
Myc.Data.Keyword,
Myc.Ast.Types;
type
// --- Forward Declarations to break cycles ---
@@ -39,6 +40,7 @@ type
IRecurNode = interface;
INopNode = interface;
IBoundIdentifierNode = interface;
IAstTypedNode = interface;
// Defines the concrete kinds of AST nodes
TAstNodeKind = (
@@ -157,13 +159,21 @@ type
function AsAddSeriesItem: IAddSeriesItemNode;
function AsSeriesLength: ISeriesLengthNode;
function AsRecur: IRecurNode;
function AsNop: INopNode; // Added Nop
function AsNop: INopNode;
function AsBoundIdentifierNode: IBoundIdentifierNode;
function AsTypedNode: IAstTypedNode;
property Kind: TAstNodeKind read GetKind;
end;
IAstTypedNode = interface(IAstNode)
{$region 'private'}
function GetStaticType: IStaticType;
{$endregion}
property StaticType: IStaticType read GetStaticType;
end;
INopNode = interface(IAstNode)
// A placeholder node for the UI (e.g., drag target).
// This node is illegal during compilation.