Unexpected negative interaction between subtypes and templates #51

Closed
opened 2022-08-07 16:43:43 +00:00 by glen · 1 comment
Owner

There are now a couple places where the number section has to provide identical implementations for the Pocomath types number and NumInt. That's because if not, then eventually some generic template that's not right for number gets instantiated (on a bunch of types). It can't displace a number implementation, but there's no guard against creating a NumInt implementation even though that type was properly handled by the previously existing number implementation.

This is a bug. It should not be necessary to repeat an implementation for subtypes to protect it from template override.

I think it ccould be fixed fairly easily with better checks in the template instantiation code. However, I am not going to work on that at the moment because the difficulty might become moot, depending on which parts of Pocomath are integrated into typed-function, and how.

There are now a couple places where the `number` section has to provide identical implementations for the Pocomath types `number` and `NumInt`. That's because if not, then eventually some generic template that's not right for `number` gets instantiated (on a bunch of types). It can't displace a `number` implementation, but there's no guard against creating a `NumInt` implementation even though that type was properly handled by the previously existing `number` implementation. This is a bug. It should not be necessary to repeat an implementation for subtypes to protect it from template override. I think it ccould be fixed fairly easily with better checks in the template instantiation code. However, I am not going to work on that at the moment because the difficulty might become moot, depending on which parts of Pocomath are integrated into typed-function, and how.
glen added the
bug
label 2022-08-07 16:43:43 +00:00
Author
Owner

Resolved by the T:number templates provided in #53.

Resolved by the `T:number` templates provided in #53.
glen closed this issue 2022-08-30 19:37:49 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: glen/pocomath#51
No description provided.