class TestCase::Operator::TypeCast {
  use TestCase::Minimal;
  use TestCase::Operator::AnonMethod::AnonMethod;
  use Comparator;
  use Fn;
  use Array;
  use Complex_2d;
  use Point;
  use TestCase::Point_3b;
  use TestCase::Point_3d;
  use TestCase::Point_3f;
  use TestCase::Point_3i;
  use TestCase::Point_3l;
  use TestCase::Point_3s;

  static method undef_to_object : int () {
    
    my $string = (string)undef;
    unless ($string == undef) {
      return 0;
    }
    
    my $object = (object)undef;
    unless ($string == undef) {
      return 0;
    }
    
    return 1;
  }

  static method to_numeric_array : int () {
    my $onums_byte : object = new byte[3];
    my $nums_byte = (byte[])$onums_byte;
    my $onums_short : object = new short[3];
    my $nums_short = (short[])$onums_short;
    my $onums_int : object = new int[3];
    my $nums_int = (int[])$onums_int;
    my $onums_long : object = new long[3];
    my $nums_long = (long[])$onums_long;
    my $onums_float : object = new float[3];
    my $nums_float = (float[])$onums_float;
    my $onums_double : object = new double[3];
    my $nums_double = (double[])$onums_double;
    
    return 1;
  }
  
  static method to_any_object : int () {
    my $object = (object)new TestCase::Minimal[3];
    
    return 1;
  }
  
  static method undef_to_any_object : int () {
    my $minimal : TestCase::Minimal;
    my $object = (object)$minimal;
    
    unless ($object == undef) {
      return 0;
    }
    
    return 1;
  }
  
  static method undef_to_object2 : int () {
    my $minimal : TestCase::Minimal;
    my $object = (TestCase::Minimal)$minimal;
    
    unless ($object == undef) {
      return 0;
    }
    
    return 1;
  }
  
  static method undef_to_ref : int () {
    {
      my $ref = (int*)undef;
      
      unless ($ref == undef) {
        return 0;
      }
      
      if ($ref) {
        return 0;
      }
    }
    
    {
      my $ref = (Complex_2d*)undef;
      
      unless ($ref == undef) {
        return 0;
      }
    }
    
    return 1;
  }
  
  static method to_callback : int () {
    my $comparator = method : int ($object1 : object, $object2 : object) {
      return 5;
    };
    
    my $object : object = $comparator;
    
    my $comparator2 = (Comparator)$object;
    
    unless ($comparator2->(undef, undef) == 5) {
      return 0;
    }
    
    return 1;
  }
  
  static method undef_to_callback : int () {
    my $comparator : Comparator;
    
    my $comparator2 = (Comparator)$comparator;
    
    unless ($comparator2 == undef) {
      return 0;
    }
    
    return 1;
  }
  
  static method to_object_array : int () {
    my $ominimals : object = new TestCase::Minimal[3];
    my $minimals = (TestCase::Minimal[])$ominimals;
    
    return 1;
  }
  
  static method to_callback_array : int () {
    my $ocallbacks : object = new TestCase::Operator::AnonMethod::AnonMethod[3];
    my $callbacks = (TestCase::Operator::AnonMethod::AnonMethod[])$ocallbacks;
    
    return 1;
  }
  
  # Convert type - floating point narrowing convertion
  static method float_to_byte : int () {
    my $value = (byte)127.1f;
    
    unless ($value == 127) {
      return 0;
    }
    
    return 1;
  }
  
  static method float_to_short : int () {
    my $value = (short)32767.1f;
    
    unless ($value == 32767) {
      return 0;
    }
    
    return 1;
  }
  
  static method float_to_int : int () {
    my $value = (int)132767.1f;
    
    unless ($value == 132767) {
      return 0;
    }
    
    return 1;
  }
  
  static method float_to_long : int () {
    my $value = (long)132767.1f;
    
    unless ($value == 132767L) {
      return 0;
    }
    
    return 1;
  }
  
  static method double_to_byte : int () {
    my $value = (byte)127.1;
    
    unless ($value == 127) {
      return 0;
    }
    
    return 1;
  }
  
  static method double_to_short : int () {
    my $value = (short)32767.1;
    
    unless ((int)$value == (int)(short)32767) {
      return 0;
    }
    
    return 1;
  }
  
  static method double_to_int : int () {
    my $value = (int)2147483646.1;
    
    unless ($value == 2147483646) {
      return 0;
    }
    
    return 1;
  }
  
  static method double_to_long : int () {
    my $value = (long)2147483646.1;
    
    unless ($value == 2147483646L) {
      return 0;
    }
    
    return 1;
  }
  
  static method double_to_float : int () {
    
    {
      my $value = (float)0.5;
      
      unless ($value == 0.5f) {
        return 0;
      }
    }
    
    {
      my $value : float = 0.5;
      
      unless ($value == 0.5f) {
        return 0;
      }
    }
    
    {
      my $value : float = 0.3;
      
      unless ($value == 0.3f) {
        return 0;
      }
    }
    
    {
      my $values = [(float)0.5, 0.3];
      
      unless ($values->[0] == 0.5f) {
        return 0;
      }
      
      unless ($values->[1] == 0.3f) {
        return 0;
      }
    }
    
    return 1;
  }
  
  # Convert type - floating point widning convertion
  static method byte_to_float : int () {
    my $value = (float)(byte)127;
    
    unless ($value == 127.0f) {
      return 0;
    }
    
    return 1;
  }
  static method short_to_float : int () {
    my $value = (float)(short)32767;
    
    unless ($value == 32767.0f) {
      return 0;
    }
    
    return 1;
  }
  static method int_to_float : int () {
    my $value = (float)32767;
    
    unless ($value == 32767.0f) {
      return 0;
    }
    
    return 1;
  }
  static method long_to_float : int () {
    my $value = (float)32767L;
    
    unless ($value == 32767.0f) {
      return 0;
    }
    
    return 1;
  }
  static method byte_to_double : int () {
    my $value = (double)(byte)127;
    
    unless ($value == 127.0) {
      return 0;
    }
    
    return 1;
  }
  static method short_to_double : int () {
    my $value = (double)(short)32767;
    
    unless ($value == 32767.0) {
      return 0;
    }
    
    return 1;
  }
  static method int_to_double : int () {
    my $value = (double)2147483647;
    unless ($value == 2147483647.0) {
      return 0;
    }
    
    return 1;
  }
  static method long_to_double : int () {
    my $value = (double)2147483647L;
    
    unless ($value == 2147483647.0) {
      return 0;
    }
    
    return 1;
  }
  static method float_to_double : int () {
    my $value = (double)32767.0f;
    
    unless ($value == 32767.0) {
      return 0;
    }
    
    return 1;
  }
  
  # Convert type - widning convertion
  static method byte_to_short_plus : int () {
    my $value = (short)(byte)0x7F;
    
    unless ((int)$value == (int)(short)0x007F) {
      return 0;
    }
    
    return 1;
  }
  static method byte_to_short_minus : int () {
    my $value = (short)(byte)0xFF;
    
    unless ((int)$value == (int)(short)0xFFFF) {
      return 0;
    }
    
    return 1;
  }
  static method byte_to_int_plus : int () {
    my $value = (int)(byte)0x7F;
    
    unless ($value == 0x0000007F) {
      return 0;
    }
    
    return 1;
  }
  static method byte_to_int_minus : int () {
    my $value = (int)(byte)0xFF;
    
    unless ($value == 0xFFFFFFFF) {
      return 0;
    }
    
    return 1;
  }
  static method byte_to_long_plus : int () {
    my $value = (long)(byte)0x7F;
    
    unless ($value == 0x000000000000007FL) {
      return 0;
    }
    
    return 1;
  }
  static method byte_to_long_minus : int () {
    my $value = (long)(byte)0xFF;
    
    unless ($value == 0xFFFFFFFFFFFFFFFFL) {
      return 0;
    }
    
    return 1;
  }
  static method short_to_int_plus : int () {
    my $value = (int)(short)0x7FFF;
    
    unless ($value == 0x0000007FFF) {
      return 0;
    }
    
    return 1;
  }
  static method short_to_int_minus : int () {
    my $value = (int)(short)0xFFFF;
    
    unless ($value == 0xFFFFFFFF) {
      return 0;
    }
    
    return 1;
  }
  static method short_to_long_plus : int () {
    my $value = (long)(short)0x7FFF;
    
    unless ($value == 0x000000000000007FFFL) {
      return 0;
    }
    
    return 1;
  }
  static method short_to_long_minus : int () {
    my $value = (long)(short)0xFFFF;
    
    unless ($value == 0xFFFFFFFFFFFFFFFFL) {
      return 0;
    }
    
    return 1;
  }
  static method int_to_long_plus : int () {
    my $value = (long)0x7FFFFFFF;
    
    unless ($value == 0x000000007FFFFFFFL) {
      return 0;
    }
    
    return 1;
  }
  static method int_to_long_minus : int () {
    my $value = (long)0xFFFFFFFF;
    
    unless ($value == 0xFFFFFFFFFFFFFFFFL) {
      return 0;
    }
    
    return 1;
  }
  
  # Convert type - convert to same type
  static method long_to_long : int () {
    my $value = (long)0xFFFFFFFFFFFFFFFFL;
    
    unless ($value == 0xFFFFFFFFFFFFFFFFL) {
      return 0;
    }
    
    return 1;
  }
  static method int_to_int : int () {
    my $value = (int)0xFFFFFFFF;
    
    unless ($value == 0xFFFFFFFF) {
      return 0;
    }
    
    return 1;
  }
  static method short_to_short : int () {
    my $value = (short)(short)0xFFFF;
    
    unless ((int)$value == (int)(short)0xFFFF) {
      return 0;
    }
    
    return 1;
  }
  static method byte_to_byte : int () {
    my $value = (byte)(byte)0xFF;
    
    unless ($value == (byte)0xFF) {
      return 0;
    }
    
    return 1;
  }
  static method float_to_float : int () {
    my $value = (float)0.5f;
    
    unless ($value == 0.5f) {
      return 0;
    }
    
    return 1;
  }
  static method double_to_double : int () {
    my $value = (double)0.5;
    
    unless ($value == 0.5) {
      return 0;
    }
    
    return 1;
  }
  
  # Convert type - integral narrowing convertion
  static method long_to_int : int () {
    my $value = (int)0xFFFFFFFFFFFFFFFFL;
    
    unless ($value == 0xFFFFFFFF) {
      return 0;
    }
    
    return 1;
  }
  static method long_to_short : int () {
    my $value = (short)0xFFFFFFFFFFFFFFFFL;
    
    unless ((int)$value == (int)(short)0xFFFF) {
      return 0;
    }
    
    return 1;
  }
  static method long_to_byte : int () {
    my $value = (byte)0xFFFFFFFFFFFFFFFFL;
    
    unless ((int)$value == (int)(byte)0xFF) {
      return 0;
    }
    
    return 1;
  }
  static method int_to_short : int () {
    my $value = (short)0xFFFFFFFF;
    
    unless ((int)$value == (int)(short)0xFFFF) {
      return 0;
    }
    
    return 1;
  }
  static method int_to_byte : int () {
    my $value = (byte)0xFFFFFFFF;
    
    unless ((int)$value == (int)(byte)0xFF) {
      return 0;
    }
    
    return 1;
  }
  static method short_to_byte : int () {
    my $value = (byte)(short)0xFFFF;
    
    unless ((int)$value == (int)(byte)0xFF) {
      return 0;
    }
    
    return 1;
  }
  
  static method byte_to_string : int () {
    {
      my $byte_string = (string)(byte)127;
      
      unless ($byte_string eq "127") {
        return 0;
      }
    }
    
    {
      my $byte_string = (string)(byte)-128;
      
      unless ($byte_string eq "-128") {
        return 0;
      }
    }
    
    return 1;
  }

  static method short_to_string : int () {
    {
      my $short_string = (string)(short)32767;
      
      unless ($short_string eq "32767") {
        return 0;
      }
    }
    
    {
      my $short_string = (string)(short)-32768;
      
      unless ($short_string eq "-32768") {
        return 0;
      }
    }
    
    return 1;
  }

  static method int_to_string : int () {
    {
      my $int_string = (string)2147483647;
      
      unless ($int_string eq "2147483647") {
        return 0;
      }
    }
    
    {
      my $int_string = (string)-2147483648;
      
      unless ($int_string eq "-2147483648") {
        return 0;
      }
    }
    return 1;
  }

  static method long_to_string : int () {
    {
      my $long_string = (string)9223372036854775807L;
      
      unless ($long_string eq "9223372036854775807") {
        diag $long_string;
        return 0;
      }
    }
    
    {
      my $long_string = (string)-9223372036854775808L;
      
      unless ($long_string eq "-9223372036854775808") {
        diag $long_string;
        return 0;
      }
    }
    
    return 1;
  }

  static method float_to_string : int () {
    my $float_string = (string)0.25000f;
    
    unless ($float_string eq "0.25") {
      return 0;
    }
    
    unless ((string)0.123f eq "0.123") {
      return 0;
    }
    
    unless ((string) -0.123f eq "-0.123") {
      return 0;
    }
    
    unless ((string)3.14f eq "3.14") {
      return 0;
    }
    
    unless ((string)-3.14f eq "-3.14") {
      return 0;
    }
    
    unless ((string)123.987f eq "123.987") {
      return 0;
    }
    
    unless ((string)-123.987f eq "-123.987") {
      return 0;
    }
    
    unless ((string)1.23456e+1f eq "12.3456") {
      return 0;
    }
    
    unless ((string)1.23456e-1f eq "0.123456") {
      return 0;
    }
    
    unless ((string)1.23456e+08f eq "1.23456e+08") {
      return 0;
    }
    
    unless ((string)1.23456e-08f eq "1.23456e-08") {
      return 0;
    }
    
    unless ((string)1.23456e+008f eq "1.23456e+08") {
      return 0;
    }
    
    unless ((string)1.23456e-008f eq "1.23456e-08") {
      return 0;
    }
    
    unless ((string)1.23456e+018f eq "1.23456e+18") {
      return 0;
    }
    
    unless ((string)1.23456e-018f eq "1.23456e-18") {
      return 0;
    }
    
    {
      my $output = (string)9.9e+300f;
      
      unless ($output eq "inf") {
        warn "$output";
        return 0;
      }
    }
    
    {
      my $output = (string)9.9e-300f;
      
      unless ($output eq "0") {
        warn "$output";
        return 0;
      }
    }
    
    {
      my $output = (string)-1.23e+123f;
      
      unless ($output eq "-inf") {
        warn "$output";
        return 0;
      }
    }
    
    {
      my $output = (string)(0.0f / 0.0f);
      
      unless ($output eq "nan" || $output eq "-nan") {
        warn "$output";
        return 0;
      }
    }
    
    return 1;
  }

  static method double_to_string : int () {
    my $double_string = (string)0.25000;

    unless ($double_string eq "0.25") {
      return 0;
    }
    
    unless ((string)0.123 eq "0.123") {
      return 0;
    }
    
    unless ((string) -0.123 eq "-0.123") {
      return 0;
    }
    
    unless ((string)3.14 eq "3.14") {
      return 0;
    }
    
    unless ((string)-3.14 eq "-3.14") {
      return 0;
    }
    unless ((string)123.987 eq "123.987") {
      return 0;
    }
    
    unless ((string)-123.987 eq "-123.987") {
      return 0;
    }
    
    unless ((string)1.23456e+1 eq "12.3456") {
      return 0;
    }
    
    unless ((string)1.23456e-1 eq "0.123456") {
      return 0;
    }
    
    unless ((string)1.23456e+08 eq "1.23456e+08") {
      return 0;
    }
    
    unless ((string)1.23456e-08 eq "1.23456e-08") {
      return 0;
    }
    
    unless ((string)1.23456e+008 eq "1.23456e+08") {
      return 0;
    }
    
    unless ((string)1.23456e-008 eq "1.23456e-08") {
      return 0;
    }
    
    unless ((string)1.23456e+018 eq "1.23456e+18") {
      return 0;
    }
    
    unless ((string)1.23456e-018 eq "1.23456e-18") {
      return 0;
    }
    
    unless ((string)9.9e+300 eq "9.9e+300") {
      return 0;
    }
    unless ((string)9.9e-300 eq "9.9e-300") {
      return 0;
    }
    unless ((string)-1.23e+123 eq "-1.23e+123") {
      return 0;
    }
    
    return 1;
  }

  static method byte_to_byte_object : int () {
    my $byte : byte = Fn->INT8_MIN;
    my $object = (Byte)$byte;
    
    unless ($object isa Byte) {
      return 0;
    }
    
    unless ($object->value == Fn->INT8_MIN) {
      return 0;
    }
    
    return 1;
  }


  static method short_to_short_object : int () {
    my $short : short = Fn->INT16_MIN;
    my $object = (Short)$short;
    
    unless ($object isa Short) {
      return 0;
    }
    
    unless ($object->value == Fn->INT16_MIN) {
      return 0;
    }
    
    return 1;
  }

  static method int_to_int_object : int () {
    my $int : int = Fn->INT32_MIN;
    my $object = (Int)$int;
    
    unless ($object isa Int) {
      return 0;
    }
    
    unless ($object->value == Fn->INT32_MIN) {
      return 0;
    }
    
    return 1;
  }

  static method long_to_long_object : int () {
    my $long : long = Fn->INT64_MIN;
    my $object = (Long)$long;
    
    unless ($object isa Long) {
      return 0;
    }
    
    unless ($object->value == Fn->INT64_MIN) {
      return 0;
    }
    
    return 1;
  }

  static method float_to_float_object : int () {
    my $float : float = Fn->FLT_MIN;
    my $object = (Float)$float;
    
    unless ($object isa Float) {
      return 0;
    }
    
    unless ($object->value == Fn->FLT_MIN) {
      return 0;
    }
    
    return 1;
  }

  static method double_to_double_object : int () {
    my $double : double = Fn->DBL_MIN;
    my $object = (Double)$double;
    
    unless ($object isa Double) {
      return 0;
    }
    
    unless ($object->value == Fn->DBL_MIN) {
      return 0;
    }
    return 1;
  }

  static method byte_to_any_object : int () {
    my $byte : byte = Fn->INT8_MIN;
    my $object = (object)$byte;
    
    unless ($object isa Byte) {
      return 0;
    }
    
    my $object2 = (Byte)$object;
    unless ($object2->value == Fn->INT8_MIN) {
      return 0;
    }
    
    return 1;
  }

  static method short_to_any_object : int () {
    my $short : short = Fn->INT16_MIN;
    my $object = (object)$short;
    
    unless ($object isa Short) {
      return 0;
    }
    
    my $object2 = (Short)$object;
    unless ($object2->value == Fn->INT16_MIN) {
      return 0;
    }
    return 1;
  }

  static method int_to_any_object : int () {
    my $int : int = Fn->INT32_MIN;
    my $object = (object)$int;
    
    unless ($object isa Int) {
      return 0;
    }
    
    my $object2 = (Int)$object;
    unless ($object2->value == Fn->INT32_MIN) {
      return 0;
    }
    
    return 1;
  }

  static method long_to_any_object : int () {
    my $long : long = Fn->INT64_MIN;
    my $object = (object)$long;
    
    unless ($object isa Long) {
      return 0;
    }
    
    my $object2 = (Long)$object;
    unless ($object2->value == Fn->INT64_MIN) {
      return 0;
    }
    
    return 1;
  }

  static method float_to_any_object : int () {
    my $float : float = Fn->FLT_MIN;
    my $object = (object)$float;
    
    unless ($object isa Float) {
      return 0;
    }
    
    my $object2 = (Float)$object;
    unless ($object2->value == Fn->FLT_MIN) {
      return 0;
    }
    
    return 1;
  }

  static method double_to_any_object : int () {
    my $double : double = Fn->DBL_MIN;
    my $object = (object)$double;
    
    unless ($object isa Double) {
      return 0;
    }
    
    my $object2 = (Double)$object;
    unless ($object2->value == Fn->DBL_MIN) {
      return 0;
    }
    
    return 1;
  }

  static method byte_object_to_byte : int () {
    my $object = Byte->new(Fn->INT8_MIN);
    my $byte = (byte)$object;
    
    unless ($byte == Fn->INT8_MIN) {
      return 0;
    }
    return 1;
  }

  static method short_object_to_short : int () {
    my $object = Short->new(Fn->INT16_MIN);
    my $short = (short)$object;
    
    unless ($short == Fn->INT16_MIN) {
      return 0;
    }
    return 1;
  }

  static method int_object_to_int : int () {
    my $object = Int->new(Fn->INT32_MIN);
    my $int = (int)$object;
    
    unless ($int == Fn->INT32_MIN) {
      return 0;
    }
    return 1;
  }

  static method long_object_to_long : int () {
    my $object = Long->new(Fn->INT64_MIN);
    my $long = (long)$object;
    
    unless ($long == Fn->INT64_MIN) {
      return 0;
    }
    return 1;
  }

  static method float_object_to_float : int () {
    my $object = Float->new(Fn->FLT_MIN);
    my $float = (float)$object;
    
    unless ($float == Fn->FLT_MIN) {
      return 0;
    }
    return 1;
  }
  static method double_object_to_double : int () {
    my $object = Double->new(Fn->DBL_MIN);
    my $double = (double)$object;
    
    unless ($double == Fn->DBL_MIN) {
      return 0;
    }
    return 1;
  }

  static method any_object_to_byte : int () {
    
    {
      my $object = (object)Byte->new(Fn->INT8_MIN);
      my $value = (byte)$object;
      
      unless ($value == Fn->INT8_MIN) {
        return 0;
      }
    }
    
    {
      my $object = (object)undef;
      my $value = (byte)$object;
      
      unless ($value == 0) {
        return 0;
      }
    }
    
    {
      my $object = (Byte)undef;
      my $value = (byte)$object;
      
      unless ($value == 0) {
        return 0;
      }
    }
    {
      {
        my $object = (object)Byte->new(-1);
        my $value = (byte)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Byte->new(-1);
        my $value = (short)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Byte->new(-1);
        my $value = (int)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Byte->new(-1);
        my $value = (long)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Byte->new(-1);
        my $value = (float)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Byte->new(-1);
        my $value = (double)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Byte->new(-1);
        eval { my $value = (Point)$object; }
        
        unless ($@) {
          return 0;
        }
      }
    }
    
    return 1;
  }

  static method any_object_to_short : int () {
    my $object = (object)Short->new(Fn->INT16_MIN);
    my $value = (short)$object;
    
    unless ($value == Fn->INT16_MIN) {
      return 0;
    }
    
    {
      my $object = (Short)undef;
      my $value = (short)$object;
      
      unless ($value == 0) {
        return 0;
      }
    }
    
    {
      my $object = (object)undef;
      my $value = (short)$object;
      
      unless ($value == 0) {
        return 0;
      }
    }
    
    {
      {
        my $object = (object)Short->new(-1);
        my $value = (byte)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Short->new(-1);
        my $value = (short)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Short->new(-1);
        my $value = (int)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Short->new(-1);
        my $value = (long)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Short->new(-1);
        my $value = (float)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Short->new(-1);
        my $value = (double)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Short->new(-1);
        eval { my $value = (Point)$object; }
        
        unless ($@) {
          return 0;
        }
      }
    }
    
    return 1;
  }

  static method any_object_to_int : int () {
    my $object = (object)Int->new(Fn->INT32_MIN);
    my $value = (int)$object;
    
    unless ($value == Fn->INT32_MIN) {
      return 0;
    }
    
    {
      my $object = (Int)undef;
      my $value = (int)$object;
      
      unless ($value == 0) {
        return 0;
      }
    }
    
    {
      my $object = (object)undef;
      my $value = (int)$object;
      
      unless ($value == 0) {
        return 0;
      }
    }
    
    {
      {
        my $object = (object)Int->new(-1);
        my $value = (byte)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Int->new(-1);
        my $value = (short)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Int->new(-1);
        my $value = (int)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Int->new(-1);
        my $value = (long)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Int->new(-1);
        my $value = (float)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Int->new(-1);
        my $value = (double)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Int->new(-1);
        eval { my $value = (Point)$object; }
        
        unless ($@) {
          return 0;
        }
      }
    }
    
    return 1;
  }

  static method any_object_to_long : int () {
    my $object = (object)Long->new(Fn->INT64_MIN);
    my $value = (long)$object;
    
    unless ($value == Fn->INT64_MIN) {
      return 0;
    }
    
    {
      my $object = (Long)undef;
      my $value = (long)$object;
      
      unless ($value == 0) {
        return 0;
      }
    }
    
    {
      my $object = (object)undef;
      my $value = (long)$object;
      
      unless ($value == 0) {
        return 0;
      }
    }
    
    {
      {
        my $object = (object)Long->new(-1);
        my $value = (byte)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Long->new(-1);
        my $value = (short)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Long->new(-1);
        my $value = (int)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Long->new(-1);
        my $value = (long)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Long->new(-1);
        my $value = (float)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Long->new(-1);
        my $value = (double)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Long->new(-1);
        eval { my $value = (Point)$object; }
        
        unless ($@) {
          return 0;
        }
      }
    }
    
    return 1;
  }

  static method any_object_to_float : int () {
    my $object = (object)Float->new(Fn->FLT_MIN);
    my $value = (float)$object;
    
    unless ($value == Fn->FLT_MIN) {
      return 0;
    }
    
    {
      my $object = (Float)undef;
      my $value = (float)$object;
      
      unless ($value == 0) {
        return 0;
      }
    }
    
    {
      my $object = (object)undef;
      my $value = (float)$object;
      
      unless ($value == 0) {
        return 0;
      }
    }
    
    {
      {
        my $object = (object)Float->new(-1);
        my $value = (byte)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Float->new(-1);
        my $value = (short)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Float->new(-1);
        my $value = (int)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Float->new(-1);
        my $value = (long)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Float->new(-1);
        my $value = (float)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Float->new(-1);
        my $value = (double)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Float->new(-1);
        eval { my $value = (Point)$object; }
        
        unless ($@) {
          return 0;
        }
      }
    }
    
    return 1;
  }
  static method any_object_to_double : int () {
    my $object = (object)Double->new(Fn->DBL_MIN);
    my $value = (double)$object;
    
    unless ($value == Fn->DBL_MIN) {
      return 0;
    }
    
    {
      my $object = (Double)undef;
      my $value = (double)$object;
      
      unless ($value == 0) {
        return 0;
      }
    }
    
    {
      my $object = (object)undef;
      my $value = (double)$object;
      
      unless ($value == 0) {
        return 0;
      }
    }
    
    {
      {
        my $object = (object)Double->new(-1);
        my $value = (byte)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Double->new(-1);
        my $value = (short)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Double->new(-1);
        my $value = (int)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Double->new(-1);
        my $value = (long)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Double->new(-1);
        my $value = (float)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Double->new(-1);
        my $value = (double)$object;
        
        unless ($value == -1) {
          return 0;
        }
      }
      
      {
        my $object = (object)Double->new(-1);
        eval { my $value = (Point)$object; }
        
        unless ($@) {
          return 0;
        }
      }
    }
    
    return 1;
  }

  static method postfix : int () {
    
    my $num = 3;
    
    my $string = $num->(string);
    
    unless ($string isa string) {
      return 0;
    }
    
    unless ($string eq "3") {
      return 0;
    }
    
    return 1;
  }

  static method string_to_byte : int () {
    
    {
      my $string = (string)undef;
      
      my $num = (byte)$string;
      
      unless ($num == 0) {
        return 0;
      }
    }
    
    {
      my $string = (string)"";
      
      my $num = (byte)$string;
      
      unless ($num == 0) {
        return 0;
      }
    }
    
    {
      my $string = (string)Fn->BYTE_MAX;
      
      my $num = (byte)$string;
      
      unless ($num == Fn->BYTE_MAX) {
        return 0;
      }
    }
    
    {
      my $string = (string)(Fn->BYTE_MAX + 1);
      
      my $num = (byte)$string;
      
      unless ($num == Fn->BYTE_MAX) {
        return 0;
      }
    }
    
    {
      my $string = (string)(Fn->BYTE_MIN);
      
      my $num = (byte)$string;
      
      unless ($num == Fn->BYTE_MIN) {
        return 0;
      }
    }
    
    {
      my $string = (string)(Fn->BYTE_MIN - 1);
      
      my $num = (byte)$string;
      
      unless ($num == Fn->BYTE_MIN) {
        return 0;
      }
    }
    
    return 1;
  }
  
  static method string_to_short : int () {
    
    {
      my $string = (string)undef;
      
      my $num = (short)$string;
      
      unless ($num == 0) {
        return 0;
      }
    }
    
    {
      my $string = (string)"";
      
      my $num = (short)$string;
      
      unless ($num == 0) {
        return 0;
      }
    }
    
    {
      my $string = (string)Fn->SHORT_MAX;
      
      my $num = (short)$string;
      
      unless ($num == Fn->SHORT_MAX) {
        return 0;
      }
    }
    
    {
      my $string = (string)(Fn->SHORT_MAX + 1);
      
      my $num = (short)$string;
      
      unless ($num == Fn->SHORT_MAX) {
        return 0;
      }
    }
    
    {
      my $string = (string)(Fn->SHORT_MIN);
      
      my $num = (short)$string;
      
      unless ($num == Fn->SHORT_MIN) {
        return 0;
      }
    }
    
    {
      my $string = (string)(Fn->SHORT_MIN - 1);
      
      my $num = (short)$string;
      
      unless ($num == Fn->SHORT_MIN) {
        return 0;
      }
    }
    
    return 1;
  }
  
  static method string_to_int : int () {
    
    {
      my $string = (string)undef;
      
      my $num = (int)$string;
      
      unless ($num == 0) {
        return 0;
      }
    }
    
    {
      my $string = (string)"";
      
      my $num = (int)$string;
      
      unless ($num == 0) {
        return 0;
      }
    }
    
    {
      my $string = (string)"1A";
      
      my $num = (int)$string;
      
      unless ($num == 1) {
        return 0;
      }
    }
    
    {
      my $string = (string)Fn->INT_MAX;
      
      my $num = (int)$string;
      
      unless ($num == Fn->INT_MAX) {
        return 0;
      }
    }
    
    {
      my $string = (string)((long)Fn->INT_MAX + 1);
      
      my $num = (int)$string;
      
      unless ($num == Fn->INT_MAX) {
        return 0;
      }
    }
    
    {
      my $string = (string)(Fn->INT_MIN);
      
      my $num = (int)$string;
      
      unless ($num == Fn->INT_MIN) {
        return 0;
      }
    }
    
    {
      my $string = (string)((long)Fn->INT_MIN - 1);
      
      my $num = (int)$string;
      
      unless ($num == Fn->INT_MIN) {
        return 0;
      }
    }
    
    return 1;
  }
  
  static method string_to_long : long () {
    
    {
      my $string = (string)undef;
      
      my $num = (long)$string;
      
      unless ($num == 0) {
        return 0;
      }
    }
    
    {
      my $string = (string)"";
      
      my $num = (long)$string;
      
      unless ($num == 0) {
        return 0;
      }
    }
    
    {
      my $string = (string)Fn->LONG_MAX;
      
      my $num = (long)$string;
      
      unless ($num == Fn->LONG_MAX) {
        return 0;
      }
    }
    
    {
      my $string = (string)Fn->LONG_MIN;
      
      my $num = (long)$string;
      
      unless ($num == Fn->LONG_MIN) {
        return 0;
      }
    }
    
    return 1;
  }
  
  static method string_to_float : float () {
    
    {
      my $string = (string)undef;
      
      my $num = (float)$string;
      
      unless ($num == 0) {
        return 0;
      }
    }
    
    {
      my $string = (string)"";
      
      my $num = (float)$string;
      
      unless ($num == 0) {
        return 0;
      }
    }
    
    {
      my $string = (string)0.5;
      
      my $num = (float)$string;
      
      unless ($num == 0.5) {
        return 0;
      }
    }
    
    return 1;
  }
  
  static method string_to_double : double () {
    
    {
      my $string = (string)undef;
      
      my $num = (double)$string;
      
      unless ($num == 0) {
        return 0;
      }
    }
    
    {
      my $string = (string)"";
      
      my $num = (double)$string;
      
      unless ($num == 0) {
        return 0;
      }
    }
    
    {
      my $string = "2147483647.5";
      
      my $num = (double)$string;
      
      unless ($num == 2147483647.5) {
        return 0;
      }
    }
    
    return 1;
  }
  
  static method string_to_byte_array : int () {
    
    {
      my $string = (string)undef;
      
      my $byte_array = (byte[])$string;
      
      unless ($byte_array == undef) {
        return 0;
      }
    }
    
    {
      my $string = (string)"";
      
      my $byte_array = (byte[])$string;
      
      unless ($byte_array eq "") {
        return 0;
      }
    }
    
    {
      my $string = (string)"abc";
      
      my $byte_array = (byte[])$string;
      
      if ($byte_array == $string) {
        return 0;
      }
      
      unless ($byte_array eq "abc") {
        return 0;
      }
    }
    
    return 1;
  }
  
  static method to_numeric_type : int () {
    
    # To numeric
    {
      # To byte
      {
        # byte to byte
        {
          my $from : byte = -1;
          my $to = (byte)$from;
          
          unless ($to isa byte) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # short to byte
        {
          my $from : short = -1;
          my $to = (byte)$from;
          
          unless ($to isa byte) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # int to byte
        {
          my $from : int = -1;
          my $to = (byte)$from;
          
          unless ($to isa byte) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # long to byte
        {
          my $from : long = -1;
          my $to = (byte)$from;
          
          unless ($to isa byte) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # float to byte
        {
          my $from : float = -1;
          my $to = (byte)$from;
          
          unless ($to isa byte) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # double to byte
        {
          my $from : double = -1;
          my $to = (byte)$from;
          
          unless ($to isa byte) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }


        # Byte object to byte
        {
          my $from = Byte->new(-1);
          my $to = (byte)$from;
          
          unless ($to isa byte) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
        
        # any object to byte
        {
          my $from : object = Byte->new(-1);
          my $to = (byte)$from;
          
          unless ($to isa byte) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
      }
      
      # To short
      {
        # byte to short
        {
          my $from : byte = -1;
          my $to = (short)$from;
          
          unless ($to isa short) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # short to short
        {
          my $from : short = -1;
          my $to = (short)$from;
          
          unless ($to isa short) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
        
        # int to short
        {
          my $from : int = -1;
          my $to = (short)$from;
          
          unless ($to isa short) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # long to short
        {
          my $from : long = -1;
          my $to = (short)$from;
          
          unless ($to isa short) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # float to short
        {
          my $from : float = -1;
          my $to = (short)$from;
          
          unless ($to isa short) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # double to short
        {
          my $from : double = -1;
          my $to = (short)$from;
          
          unless ($to isa short) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
        
        # Short object to short
        {
          my $from = Short->new(-1);
          my $to = (short)$from;
          
          unless ($to isa short) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # any object to short
        {
          my $from : object = Short->new(-1);
          my $to = (short)$from;
          
          unless ($to isa short) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
      }
      
      # To int
      {
        # byte to int
        {
          my $from : byte = -1;
          my $to = (int)$from;
          
          unless ($to isa int) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # short to int
        {
          my $from : short = -1;
          my $to = (int)$from;
          
          unless ($to isa int) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # int to int
        {
          my $from : int = -1;
          my $to = (int)$from;
          
          unless ($to isa int) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # long to int
        {
          my $from : long = -1;
          my $to = (int)$from;
          
          unless ($to isa int) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # float to int
        {
          my $from : float = -1;
          my $to = (int)$from;
          
          unless ($to isa int) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
        
        # double to int
        {
          my $from : double = -1;
          my $to = (int)$from;
          
          unless ($to isa int) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }


        # Int object to int
        {
          my $from = Int->new(-1);
          my $to = (int)$from;
          
          unless ($to isa int) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
        
        # any object to int
        {
          my $from : object = Int->new(-1);
          my $to = (int)$from;
          
          unless ($to isa int) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
      }
      
      # To long
      {
        # byte to long
        {
          my $from : byte = -1;
          my $to = (long)$from;
          
          unless ($to isa long) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # short to long
        {
          my $from : short = -1;
          my $to = (long)$from;
          
          unless ($to isa long) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # int to long
        {
          my $from : int = -1;
          my $to = (long)$from;
          
          unless ($to isa long) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # long to long
        {
          my $from : long = -1;
          my $to = (long)$from;
          
          unless ($to isa long) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # float to long
        {
          my $from : float = -1;
          my $to = (long)$from;
          
          unless ($to isa long) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # double to long
        {
          my $from : double = -1;
          my $to = (long)$from;
          
          unless ($to isa long) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # Long object to long
        {
          my $from = Long->new(-1);
          my $to = (long)$from;
          
          unless ($to isa long) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # any object to long
        {
          my $from : object = Long->new(-1);
          my $to = (long)$from;
          
          unless ($to isa long) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
      }
      
      # To float
      {
        # byte to float
        {
          my $from : byte = -1;
          my $to = (float)$from;
          
          unless ($to isa float) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
        
        # short to float
        {
          my $from : short = -1;
          my $to = (float)$from;
          
          unless ($to isa float) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
        
        # int to float
        {
          my $from : int = -1;
          my $to = (float)$from;
          
          unless ($to isa float) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
        
        # long to float
        {
          my $from : long = -1;
          my $to = (float)$from;
          
          unless ($to isa float) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
        
        # float to float
        {
          my $from : float = -1;
          my $to = (float)$from;
          
          unless ($to isa float) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # double to float
        {
          my $from : double = -1;
          my $to = (float)$from;
          
          unless ($to isa float) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # Float object to float
        {
          my $from = Float->new(-1);
          my $to = (float)$from;
          
          unless ($to isa float) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
        
        # any object to float
        {
          my $from : object = Float->new(-1);
          my $to = (float)$from;
          
          unless ($to isa float) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
      }
      
      # To double
      {
        # byte to double
        {
          my $from : byte = -1;
          my $to = (double)$from;
          
          unless ($to isa double) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # short to double
        {
          my $from : short = -1;
          my $to = (double)$from;
          
          unless ($to isa double) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
        # int to double
        {
          my $from : int = -1;
          my $to = (double)$from;
          
          unless ($to isa double) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # long to double
        {
          my $from : long = -1;
          my $to = (double)$from;
          
          unless ($to isa double) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # float to double
        {
          my $from : float = -1;
          my $to = (double)$from;
          
          unless ($to isa double) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # double to double
        {
          my $from : double = -1;
          my $to = (double)$from;
          
          unless ($to isa double) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }

        # Double object to double
        {
          my $from = Double->new(-1);
          my $to = (double)$from;
          
          unless ($to isa double) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
        
        # any object to double
        {
          my $from : object = Double->new(-1);
          my $to = (double)$from;
          
          unless ($to isa double) {
            return 0;
          }
          unless ($to == -1) {
            return 0;
          }
        }
      }
    }

    return 1;
  }

  static method to_mulnum_type : int () {
    
    {
      {
        my $mulnum_src : TestCase::Point_3b;
        $mulnum_src->{x} = 1;
        $mulnum_src->{y} = 2;
        $mulnum_src->{z} = 3;
        
        my $mulnum_dist = (TestCase::Point_3b)$mulnum_src;
        
        unless ($mulnum_dist->{x} == 1) {
          return 0;
        }
        
        unless ($mulnum_dist->{y} == 2) {
          return 0;
        }
        
        unless ($mulnum_dist->{z} == 3) {
          return 0;
        }
      }
      {
        my $mulnum_src : TestCase::Point_3s;
        $mulnum_src->{x} = 1;
        $mulnum_src->{y} = 2;
        $mulnum_src->{z} = 3;
        
        my $mulnum_dist = (TestCase::Point_3s)$mulnum_src;
        
        unless ($mulnum_dist->{x} == 1) {
          return 0;
        }
        
        unless ($mulnum_dist->{y} == 2) {
          return 0;
        }
        
        unless ($mulnum_dist->{z} == 3) {
          return 0;
        }
      }
      {
        my $mulnum_src : TestCase::Point_3i;
        $mulnum_src->{x} = 1;
        $mulnum_src->{y} = 2;
        $mulnum_src->{z} = 3;
        
        my $mulnum_dist = (TestCase::Point_3i)$mulnum_src;
        
        unless ($mulnum_dist->{x} == 1) {
          return 0;
        }
        
        unless ($mulnum_dist->{y} == 2) {
          return 0;
        }
        
        unless ($mulnum_dist->{z} == 3) {
          return 0;
        }
      }
      {
        my $mulnum_src : TestCase::Point_3l;
        $mulnum_src->{x} = 1;
        $mulnum_src->{y} = 2;
        $mulnum_src->{z} = 3;
        
        my $mulnum_dist = (TestCase::Point_3l)$mulnum_src;
        
        unless ($mulnum_dist->{x} == 1) {
          return 0;
        }
        
        unless ($mulnum_dist->{y} == 2) {
          return 0;
        }
        
        unless ($mulnum_dist->{z} == 3) {
          return 0;
        }
      }
      {
        my $mulnum_src : TestCase::Point_3f;
        $mulnum_src->{x} = 1;
        $mulnum_src->{y} = 2;
        $mulnum_src->{z} = 3;
        
        my $mulnum_dist = (TestCase::Point_3f)$mulnum_src;
        
        unless ($mulnum_dist->{x} == 1) {
          return 0;
        }
        
        unless ($mulnum_dist->{y} == 2) {
          return 0;
        }
        
        unless ($mulnum_dist->{z} == 3) {
          return 0;
        }
      }
    }
    
    {
      {
        my $mulnum : TestCase::Point_3b;
        $mulnum->{x} = 1;
        $mulnum->{y} = 2;
        $mulnum->{z} = 3;
        $mulnum = (TestCase::Point_3b)undef;
        
        unless ($mulnum->{x} == 0) {
          return 0;
        }
        
        unless ($mulnum->{y} == 0) {
          return 0;
        }
        
        unless ($mulnum->{z} == 0) {
          return 0;
        }
      }
      {
        my $mulnum : TestCase::Point_3s;
        $mulnum->{x} = 1;
        $mulnum->{y} = 2;
        $mulnum->{z} = 3;
        $mulnum = (TestCase::Point_3s)undef;
        
        unless ($mulnum->{x} == 0) {
          return 0;
        }
        
        unless ($mulnum->{y} == 0) {
          return 0;
        }
        
        unless ($mulnum->{z} == 0) {
          return 0;
        }
      }
      {
        my $mulnum : TestCase::Point_3i;
        $mulnum->{x} = 1;
        $mulnum->{y} = 2;
        $mulnum->{z} = 3;
        $mulnum = (TestCase::Point_3i)undef;
        
        unless ($mulnum->{x} == 0) {
          return 0;
        }
        
        unless ($mulnum->{y} == 0) {
          return 0;
        }
        
        unless ($mulnum->{z} == 0) {
          return 0;
        }
      }
      {
        my $mulnum : TestCase::Point_3l;
        $mulnum->{x} = 1;
        $mulnum->{y} = 2;
        $mulnum->{z} = 3;
        $mulnum = (TestCase::Point_3l)undef;
        
        unless ($mulnum->{x} == 0) {
          return 0;
        }
        
        unless ($mulnum->{y} == 0) {
          return 0;
        }
        
        unless ($mulnum->{z} == 0) {
          return 0;
        }
      }
      {
        my $mulnum : TestCase::Point_3f;
        $mulnum->{x} = 1;
        $mulnum->{y} = 2;
        $mulnum->{z} = 3;
        $mulnum = (TestCase::Point_3f)undef;
        
        unless ($mulnum->{x} == 0) {
          return 0;
        }
        
        unless ($mulnum->{y} == 0) {
          return 0;
        }
        
        unless ($mulnum->{z} == 0) {
          return 0;
        }
      }
      {
        my $mulnum : TestCase::Point_3d;
        $mulnum->{x} = 1;
        $mulnum->{y} = 2;
        $mulnum->{z} = 3;
        $mulnum = (TestCase::Point_3d)undef;
        
        unless ($mulnum->{x} == 0) {
          return 0;
        }
        
        unless ($mulnum->{y} == 0) {
          return 0;
        }
        
        unless ($mulnum->{z} == 0) {
          return 0;
        }
      }
    }
    
    return 1;
  }

  static method to_reference_type : int () {
    my $num = 3;
    my $num_ref : int* = \$num;
    my $num_ref2 = (int*)$num_ref;
    
    my $num_deref = $$num_ref2;
    
    unless ($num_deref == 3) {
      return 0;
    }
    
    return 1;
  }

  static method to_string : int () {
    
    {
      my $byte_array = ['a', 'b', 'c'];
      unless ($byte_array isa byte[]) {
        return 0;
      }
      
      my $string = (string)$byte_array;
      
      unless ($string isa string) {
        return 0;
      }
      
      unless ($string eq "abc") {
        return 0;
      }
      
      if ($byte_array == $string) {
        return 0;
      }
    }
    
    {
      my $string = (object)"abc";
      
      eval { (mutable string)$string; }
      
      unless (Fn->contains($@, "A read-only string cannnot be cast to mutable string type.")) {
        return 0;
      }
      
    }
    
    {
      my $string = (object)"abc";
      
      my $string2 = (string)$string;
    }
    
    {
      my $string = (object)copy "abc";
      
      my $string2 = (mutable string)$string;
    }
    
    # Any object to string
    {
      {
        my $object = (object)undef;
        
        my $ret = (string)$object;
        
        if ($ret) {
          return 0;
        }
      }
      
      {
        my $object = (object)"a";
        
        eval { my $ret = (mutable string)$object; }
        
        unless ($@) {
          return 0;
        }
      }
      
      {
        {
          my $object = (object)(byte)-128;
          
          my $ret = (string)$object;
          
          unless ($ret eq "-128") {
            return 0;
          }
        }
        
        {
          my $object = (object)(short)-32768;
          
          my $ret = (string)$object;
          
          unless ($ret eq "-32768") {
            return 0;
          }
        }
        
        {
          my $object = (object)-2147483648;
          
          my $ret = (string)$object;
          
          unless ($ret eq "-2147483648") {
            return 0;
          }
        }
        
        {
          my $object = (object)-9223372036854775808L;
          
          my $ret = (string)$object;
          
          unless ($ret eq "-9223372036854775808") {
            return 0;
          }
        }
        
        {
          my $object = (object)1.5f;
          
          my $ret = (string)$object;
          
          unless ($ret eq "1.5") {
            return 0;
          }
        }
        
        {
          my $object = (object)1.5;
          
          my $ret = (string)$object;
          
          unless ($ret eq "1.5") {
            return 0;
          }
        }
        
      }
      
      {
        my $object = (object)"abc";
        
        my $ret = (string)$object;
        
        unless ($ret == $object) {
          return 0;
        }
      }
      
      {
        my $object = (object)"abc";
        
        eval { my $ret = (Point)$object; }
        
        unless ($@) {
          return 0;
        }
      }
      
    }
    
    return 1;
  }
}
