yandex / yandex/implicits

Objective-C lightweight generics break type-as-key concept

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
Swift
Stars
43
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Problem

Objective-C generics are type-erased at runtime, which breaks the type-as-key concept:

ObjectIdentifier(NSArray<NSString>.self) == ObjectIdentifier(NSArray<NSNumber>.self) // true!

This means two different implicit keys using ObjC generic types will collide.

Cause

ObjC "lightweight generics" don't preserve type parameters at runtime - they exist only for compile-time type checking.

Potential Solutions

  • Detect and warn about ObjC generic types used as implicit keys
  • Document the limitation
  • Require named keys (keypaths) for ObjC generic types

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the implicit-key handling that uses ObjectIdentifier and inspect how generic types are represented at runtime. Reproduce the collision with NSArray and NSArray; done requires an agreed resolution among warning, documentation, or named-key enforcement, with tests covering the chosen behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
objective-c, swift
Domain
tooling
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.