[SR-3056] expand constraint categories #45646
Labels
compiler
The Swift compiler in itself
feature
A feature request or implementation
generic constraints
Feature → generics: generic constraints
generics
Feature: generic declarations and types
Additional Detail from JIRA
md5: 3f1fca16fc825fade00e0b7d42a56a27
Issue Description:
Copying this here from swift-evolution to keep track of it. This may or may not be in-scope for Swift 4.
Do we already have a proposal for expanding constraints to support categories beyond class? I am guessing this might have ABI stability concerns, or at least library resilience concerns.
If so and no one else has tackled it I’m happy to write up a proposal. There are only a couple that I know of:
valuetype
Only struct and enum types would satisfy this constraint.
valuetype(pure)
A struct or enum that contain no reference types at all. The only reason to add this would be allowing certain optimizations, though the way existentials work today I’m not sure if this is even possible because the calls to value witnesses need to be emitted anyway.
functiontype
A function type. This doesn’t have much use today but eventually we could expand this to support reflecting the number and type of arguments, dynamically invoking, etc.
The text was updated successfully, but these errors were encountered: