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

stringyfication on type capture in signatures returns the literal of the type capture instead of the resolved type named #5056

Open
p6rt opened this issue Jan 16, 2016 · 1 comment

Comments

@p6rt
Copy link

p6rt commented Jan 16, 2016

Migrated from rt.perl.org#127289 (status was 'new')

Searchable as RT127289$

@p6rt
Copy link
Author

p6rt commented Jan 16, 2016

From @gfldex

class C {};
sub outer(​::T $c){
  sub (T){ dd &?ROUTINE.signature.params[0], T === C, T.new }
};
my $inner = outer(C); $inner(C.new);

# OUTPUT«T $␤Bool​::True␤C.new␤»
# expected​:
# OUTPUT«C $␤Bool​::True␤C.new

# The typecheck on function call does work. It's merely a stringy problem.

$inner(W.new);

# OUTPUT«Type check failed in binding <anon>;
# expected C but got W␤ in sub at /tmp/uEPuZVCl2m line 1␤ in block
# <unit> at /tmp/uEPuZVCl2m line 1␤␤»

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant