Skip to content

Add defgeneric/defmethod type safety and accessor type inference#3

Merged
tamurashingo merged 2 commits into
mainfrom
feature/defgeneric-type-support
Apr 15, 2026
Merged

Add defgeneric/defmethod type safety and accessor type inference#3
tamurashingo merged 2 commits into
mainfrom
feature/defgeneric-type-support

Conversation

@tamurashingo

Copy link
Copy Markdown
Owner

Summary

  • Add type support for defgeneric/defmethod: validate return types, argument counts, and specializers
  • Support defmethod without defgeneric by auto-creating generic functions with common superclass computation
  • Infer accessor/reader return types from defclass slot definitions
  • Include LSP integration, serialization, and transpilation support

Test plan

  • 26 tests added covering type extraction, transpilation, type checking, serialization, accessor inference, and common superclass computation
  • All 18 files in sample project pass check-all

Support type extraction, type checking, transpilation, LSP integration,
and serialization for defgeneric/defmethod. Validates return types,
argument counts, and specializers. Handles defmethod without defgeneric
and implicit generic functions from defclass accessors.
Extract type info from defclass :accessor/:reader slot options so that
accessor calls infer the correct return type. When auto-creating generic
functions from multiple defmethods, compute the common superclass of
specializers instead of defaulting to :t.
@tamurashingo tamurashingo merged commit 21b2505 into main Apr 15, 2026
4 checks passed
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