@@ -61,23 +61,20 @@ fn main_0() -> i32 {
6161 . borrow( ) )
6262 == 34 )
6363 ) ;
64- let i: Value < i32 > = Rc :: new ( RefCell :: new ( ( { SImpl :: operator_int ( & s. as_pointer ( ) ) } ) ) ) ;
64+ let i: Value < i32 > = Rc :: new ( RefCell :: new ( ( { SImpl :: to_i32 ( & s. as_pointer ( ) ) } ) ) ) ;
6565 assert ! ( ( ( * i. borrow( ) ) == 3 ) ) ;
66- assert ! ( ( ( ( { SImpl :: operator_int ( & s. as_pointer( ) , ) } ) + 1 ) == 4 ) ) ;
67- if ( { SImpl :: operator__Bool ( & s. as_pointer ( ) ) } ) {
68- assert ! ( ( { SImpl :: operator__Bool ( & s. as_pointer( ) , ) } ) ) ;
66+ assert ! ( ( ( ( { SImpl :: to_i32 ( & s. as_pointer( ) , ) } ) + 1 ) == 4 ) ) ;
67+ if ( { SImpl :: to_bool ( & s. as_pointer ( ) ) } ) {
68+ assert ! ( ( { SImpl :: to_bool ( & s. as_pointer( ) , ) } ) ) ;
6969 } else {
7070 assert ! ( false ) ;
7171 }
7272 let z: Value < S > = Rc :: new ( RefCell :: new ( S {
7373 v : Rc :: new ( RefCell :: new ( 0 ) ) ,
7474 } ) ) ;
75- assert ! ( ( { SImpl :: operator__Bool( & s. as_pointer( ) , ) } ) ) ;
76- assert ! ( !( { SImpl :: operator__Bool( & z. as_pointer( ) , ) } ) ) ;
77- assert ! (
78- ( { SImpl :: operator__Bool( & s. as_pointer( ) , ) } )
79- && ( !( { SImpl :: operator__Bool( & z. as_pointer( ) , ) } ) )
80- ) ;
75+ assert ! ( ( { SImpl :: to_bool( & s. as_pointer( ) , ) } ) ) ;
76+ assert ! ( !( { SImpl :: to_bool( & z. as_pointer( ) , ) } ) ) ;
77+ assert ! ( ( { SImpl :: to_bool( & s. as_pointer( ) , ) } ) && ( !( { SImpl :: to_bool( & z. as_pointer( ) , ) } ) ) ) ;
8178 let st: Value < Static > = Rc :: new ( RefCell :: new ( <Static >:: default ( ) ) ) ;
8279 assert ! ( ( ( { Static :: operator_call( 6 , 7 , ) } ) == 42 ) ) ;
8380 assert ! (
@@ -109,8 +106,8 @@ pub trait SImpl {
109106 fn operator_call_i32_const ( & self , a : i32 ) -> i32 ;
110107 fn operator_call_i32_i32_const ( & self , a : i32 , b : i32 ) -> i32 ;
111108 fn operator_comma ( & self , o : Ptr < S > ) -> S ;
112- fn operator_int ( & self ) -> i32 ;
113- fn operator__Bool ( & self ) -> bool ;
109+ fn to_i32 ( & self ) -> i32 ;
110+ fn to_bool ( & self ) -> bool ;
114111}
115112impl SImpl for Ptr < S > {
116113 fn operator_call_const ( & self ) -> i32 {
@@ -133,10 +130,10 @@ impl SImpl for Ptr<S> {
133130 } ) ) ,
134131 } ;
135132 }
136- fn operator_int ( & self ) -> i32 {
133+ fn to_i32 ( & self ) -> i32 {
137134 return ( * ( * ( * self ) . upgrade ( ) . deref ( ) ) . v . borrow ( ) ) ;
138135 }
139- fn operator__Bool ( & self ) -> bool {
136+ fn to_bool ( & self ) -> bool {
140137 return ( ( * ( * ( * self ) . upgrade ( ) . deref ( ) ) . v . borrow ( ) ) != 0 ) ;
141138 }
142139}
0 commit comments