We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access to the type variables declared in the @generic annotations of methods will be granted.
@generic
Working with lang.Type's utility methods such as cast, newInstance, isInstance and its default member comes in handy in writing generic methods.,
lang.Type
cast
newInstance
isInstance
default
#[@generic(return= 'T[]')] public function all() { $r= []; foreach ($this->list as $value) { $r[]= $T->newInstance($value); } return $r; }
n/a
Slightly slower only if type variables are used.
Removal of __generic left-overs from #193 in util.collections
__generic
The experiment this RFC is based on
The text was updated successfully, but these errors were encountered:
This is inconsistent with #214 as $T is a string and not a lang.Type instance.
$T
Sorry, something went wrong.
Fix inconsistency with xp-framework/rfc#214
cb27513
See xp-framework/rfc#282 (comment)
Implement xp-framework/rfc#282 with PR #25
4c96504
Part of XP 6, see #172
No branches or pull requests
Scope of Change
Access to the type variables declared in the
@generic
annotations of methods will be granted.Rationale
Working with
lang.Type
's utility methods such ascast
,newInstance
,isInstance
and itsdefault
member comes in handy in writing generic methods.,Functionality
General idea:
Security considerations
n/a
Speed impact
Slightly slower only if type variables are used.
Dependencies
Removal of
__generic
left-overs from #193 in util.collectionsRelated documents
The experiment this RFC is based on
The text was updated successfully, but these errors were encountered: