Skip to content
New issue

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

Type capture in parametarization NYI #1383

Open
zoffixznet opened this issue Jan 10, 2018 · 0 comments
Open

Type capture in parametarization NYI #1383

zoffixznet opened this issue Jan 10, 2018 · 0 comments
Labels
NYI Features not yet implemented roles type captures role R[::T] or sub foo(::T) (aka "captured types")

Comments

@zoffixznet
Copy link
Contributor

zoffixznet commented Jan 10, 2018

User wanting this: https://irclog.perlgeek.de/perl6/2018-01-10#i_15673129

<Zoffix_> m: -> Array[::T] \a, Array[T] \b {}(Array[Int], Array[Int])
<camelia> rakudo-moar f02606cea: OUTPUT: «===SORRY!=== Error while compiling <tmp>␤No such symbol 'T'␤at <tmp>:1␤------> -> Array[::T⏏] \a, Array[T] \b {}(Array[Int], Array[I␤»

Possible workaround:

11:13 | Zoffix | m: -> ::T \a where Array[T.of], \b where Array[T.of] {}(Array[Int], Array[Int])
-- | -- | --
11:13 | camelia | rakudo-moar f02606cea: ( no output )
11:13 | Zoffix | m: -> ::T \a where Array[T.of], \b where Array[T.of] {}(Array[Int], Array[Num])
11:13 | camelia | rakudo-moar f02606cea: OUTPUT: «Constraint type check failed in binding to parameter 'b'; expected anonymous constraint to be met but got Array[Num] (Array[Num])␤  in block <unit> at <tmp> line 1␤␤»
@zoffixznet zoffixznet added the NYI Features not yet implemented label Jan 10, 2018
@lucasbuchala lucasbuchala added the type captures role R[::T] or sub foo(::T) (aka "captured types") label Mar 14, 2019
@ab5tract ab5tract added the roles label Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NYI Features not yet implemented roles type captures role R[::T] or sub foo(::T) (aka "captured types")
Projects
None yet
Development

No branches or pull requests

3 participants