Making AST node inmmutable - WIP
This commit is contained in:
@@ -137,7 +137,7 @@ end;
|
||||
function TTypeChecker.VisitVariableDeclaration(const Node: IVariableDeclarationNode): IAstNode;
|
||||
var
|
||||
initType: IStaticType;
|
||||
boundIdent: TIdentifierNode;
|
||||
boundIdent: IIdentifierNode;
|
||||
adr: TResolvedAddress;
|
||||
begin
|
||||
// 1. Visit children first (Identifier is leaf, Initializer is traversed)
|
||||
@@ -149,9 +149,9 @@ begin
|
||||
else
|
||||
initType := TTypes.Void;
|
||||
|
||||
// 3. Get the address from the bound identifier.
|
||||
boundIdent := (Node.Identifier as TIdentifierNode);
|
||||
adr := boundIdent.Address;
|
||||
// 3. Get the address from the bound identifier (SAFE CAST)
|
||||
boundIdent := Node.Identifier;
|
||||
adr := boundIdent.AsBoundIdentifierNode.Address;
|
||||
|
||||
// 4. Update the type in the scope descriptor (which was set to Unknown by the binder).
|
||||
FCurrentDescriptor.UpdateType(adr.SlotIndex, initType);
|
||||
|
||||
Reference in New Issue
Block a user