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
Routine parameter constrained with a native type, doesn't realize when it gets boxed #6507
Comments
From vittore.scolari@gmail.comThe following script: use NativeCall :types; class a { my $a = a.new(10); class b { my $b = b.new(12); dies with error |
From @smlsIt doesn't seem to be specific to type `size_t` - it also happens with other native types such as `int`. Shorter example: ➜ sub a (int $a) { Blob[int].new($a) }; say a 12; Examples that *don't* fail: ➜ sub a (int $a is copy) { Blob[int].new($a) }; say a 12; ➜ my int $a = 12; say Blob[int].new($a); I think it's safe to say that in all four cases, `$a` gets boxed to an `Int`. But in the first case, it's as if the Blob constructor nonetheless uses the code path for `int` and subsequently gets surprised. Maybe the `int $a` signature leads the compiler to think that it will always be an `int`? |
The RT System itself - Status changed from 'new' to 'open' |
The above two failures seems to have disappeared:
|
So, closing them? |
Migrated from rt.perl.org#132052 (status was 'open')
Searchable as RT132052$
The text was updated successfully, but these errors were encountered: