Skip to content

Access-permissions on interfaces#105

Draft
pawinkler wants to merge 2 commits intomainfrom
paul/interface-permissions
Draft

Access-permissions on interfaces#105
pawinkler wants to merge 2 commits intomainfrom
paul/interface-permissions

Conversation

@pawinkler
Copy link
Copy Markdown
Collaborator

@pawinkler pawinkler commented Apr 10, 2026

Summary

This PR was extracted from #92 and concerns the implementation of interface-related permissions. Currently, we mostly apply the same permission handling to classes and interfaces, but limit the operations that can be performed with interfaces in certain locations, e.g. when traversing subtyping hierarchies. To implement a proper inheritance system, a separate permissions system for interfaces should be developed.

This PR contains some work in this regard, but lacks the fundamental theoretical backbone. Hopefully, it can be reused when a proper system for interface permissions was agreed on.

Draft — most changes were ad hoc changes that are not verified to be correct or complete.

Changes

  • Removes the isInterface: Boolean field from ClassEmbeddingDetails and replaces the field-based hierarchyPathTo(field) with a target-based hierarchyPathTo(target) backed by a private pathToOrNull that searches all class supertypes, including interfaces.
  • Moves field-to-target resolution into TypeEmbedding.hierarchyPathTo(field).

Remaining tasks

  • Development of a proper strategy to handle permissions releated to interfaces.
  • Implementation of this strategy in the codebase.

pawinkler and others added 2 commits April 9, 2026 18:04
Replace the old field-based `hierarchyPathTo(field: FieldEmbedding)` on
`ClassEmbeddingDetails` — which skipped interface supertypes via the
`isInterface` flag — with a target-based `hierarchyPathTo(target:
ClassTypeEmbedding)` backed by a private `pathToOrNull` that searches all
supertypes uniformly. Remove the now-redundant `isInterface` constructor
parameter and its passing site in `ProgramConverter`. Move field-to-target
resolution into `TypeEmbedding.hierarchyPathTo(field)`.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant