# New Ticket Created by   
# Please include the string:  [perl #124321]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=124321 >


This is as minimal as I can get the test case:

Error: (notice the signatures do in fact match, in both error text and 
code)

--cut here--
===SORRY!=== Error while compiling /home/jgoff/bug.t
Calling rl_get_screen_size(TypedPointer[Int], TypedPointer[Int]) will 
never work with declared signature (TypedPointer[Int], 
TypedPointer[Int])
at /home/jgoff/bug.t:27
------>     ⏏rl_get_screen_size( $r, $c ) }
--cut here--

The sample code is stolen directly from NativeCall.pm6 and ruthlessly 
trimmed down, the 'class Bug' is a fragment of my ReadLine library 
binding, originally a NativeCall interface.

The minimum case I can get is as below. Note *especially* the 'XXX' 
section. If I comment out the 'make_pun', the error goes away.

--cut here--
my class void  is repr('Uninstantiable') is export(:types, :DEFAULT) { 
};
my class Pointer  is repr('CPointer') is export(:types, :DEFAULT) { };

use MONKEY-TYPING;
augment class Pointer {
     my role TypedPointer[::TValue = void] is Pointer is repr('CPointer') 
{
     }

     # JMG XXX Comment out the body of this function and the bug goes 
away.
     #     XXX It may not *do* anything, but the error goes away.
     #
     method ^parameterize($, Mu:U \t) {
         my \typed := TypedPointer[t];
         typed.^make_pun;
     }
}

multi trait_mod:<is>(Routine $r, :$native!) is export(:DEFAULT, :traits) 
{
}

class Bug {
   sub rl_get_screen_size( Pointer[Int], Pointer[Int] )
     is native( 'foo' ) { * }
   method rl-get-screen-size( Pointer[Int] $r, Pointer[Int] $c ) {
     rl_get_screen_size( $r, $c ) }
}
--cut here--

Reply via email to