Skip to content

Conversation

@cirras
Copy link
Collaborator

@cirras cirras commented Apr 14, 2025

This PR fixes name resolution failures in the following scenario:

  • The name occurrence is in the method of a nested type (TFoo)
  • The name occurrence is trying to access a member of the enclosing type (TBar)
  • The name declaration is from an ancestor of the enclosing type (TBaz)

Example:

type
  TBaz = class
    class procedure BazMethod;
  end;

  TBar = class(TBaz)
    type
      TFoo = class
        procedure FooMethod;
      end;
  end;

procedure TBar.TFoo.FooMethod;
begin
  // This now correctly resolves to TBaz.BazMethod
  BazMethod;
end;

@cirras cirras requested a review from fourls April 14, 2025 01:21
@cirras cirras force-pushed the name_resolution_in_enclosing_type_scopes_looked_easier_in_the_brochure_tbh branch from 9f28f25 to 00241bf Compare April 14, 2025 01:23
@cirras cirras requested a review from fourls April 17, 2025 05:36
Copy link
Collaborator

@fourls fourls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@fourls fourls merged commit 7edb90b into master Apr 17, 2025
4 checks passed
@fourls fourls deleted the name_resolution_in_enclosing_type_scopes_looked_easier_in_the_brochure_tbh branch April 17, 2025 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants