Skip to content

[dnm] Prototype for ofType and ofGeneric TypeMarkers - #3034

Closed
atrocities wants to merge 1 commit into
developfrom
yzhou/ofgeneric-prototype
Closed

[dnm] Prototype for ofType and ofGeneric TypeMarkers#3034
atrocities wants to merge 1 commit into
developfrom
yzhou/ofgeneric-prototype

Conversation

@atrocities

Copy link
Copy Markdown

Generated Conjure code creates anon TypeMarker subclasses liberally. This is done in order to capture generic type information for parameterized classes. Since type erasure prevents directly passing in generic type information as a constructor argument for TypeMarker, the full paramaterized type must come from a subtype, and obtained with getGenericSuperclass().

As far as I can tell, the anon TypeMarker subclasses are also generated for non-paramaterized types for the sake of uniformity.

The major drawback is that these TypeMarker classes pollute the class space, and end up consuming material amounts of metaspace.

Introduce an ofGeneric factory for TypeMarker that accepts the generic type arguments for the paramaterized type as a list, and use the of factory method for TypeMarkers that encapsulate non-paramaterized types. It is, however, not actually typesafe at compile time.

@changelog-app

changelog-app Bot commented Aug 26, 2026

Copy link
Copy Markdown

Generate changelog in changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

Prototype for ofType and ofGeneric TypeMarkers

Check the box to generate changelog(s)

  • Generate changelog entry

@atrocities atrocities changed the title Prototype for ofType and ofGeneric TypeMarkers [dnm] Prototype for ofType and ofGeneric TypeMarkers Aug 26, 2026
@atrocities

Copy link
Copy Markdown
Author

Closing in favor of #3035

@atrocities atrocities closed this Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant