check: two Multiply implementations on one type are unreachable (LINEAR.md item 12) #753
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language#753
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
docs/design/LINEAR.mdlists language gaps the package met. Item 12 (line 470) is open and has no issue:extend<Scalar> Matrix2<Scalar> with Multiply<Vector2<Scalar>, Vector2<Scalar>>next towith Multiplyon the type is accepted and coherent, and thenmatrix.multiply(vector)reports "ExpectedMatrix2<Float64>, foundVector2<Float64>" whilematrix * vectorreports "Matrix2<Float64>does not implementMultiply". The checker accepts a declaration that no call can use.Source
docs/project/2026-11-cleanup-audit.md.docs/design/LINEAR.mditem 12. Related and closed: #440.Goal
A decision that the checker enforces at the declaration: either the second implementation is selected by the argument type for the method call and the operator (overloading by a trait parameter), or the second
with Multiply<...>is refused where it is written, with a message that names the other spelling (a named method such astransform).Design record point
docs/design/LINEAR.mditem 12; CONCEPT, the sections on operator traits and coherence. The recommendation of the audit is the refusal: CONCEPT has no overloading by argument type anywhere else, and one exception for operators is a second resolution rule.Acceptance criteria
matrix.multiply(vector)and formatrix * vectorDependencies
None.
Seed
None expected (
std/linearalready uses the other spelling).Size
One PR, one commit for the refusal; the overloading variant would be larger and needs a record first.