@@ -477,6 +477,7 @@ nextIntTy (ITFixed IT16) = (ITFixed IT32)
477477nextIntTy (ITFixed IT32) = (ITFixed IT64)
478478nextIntTy (ITFixed IT64) = (ITFixed IT64)
479479nextIntTy ITNative = (ITFixed IT64)
480+nextIntTy ITChar = (ITFixed IT64)
480481
481482intTyToIdent :: IntTy -> Ident
482483intTyToIdent (ITFixed IT8) = Ident "Byte"
@@ -485,6 +486,7 @@ intTyToIdent (ITFixed IT32) = Ident "Integer"
485486intTyToIdent (ITFixed IT64) = Ident "Long"
486487intTyToIdent ITNative = Ident "Integer"
487488intTyToIdent ITBig = Ident "BigInteger"
489+intTyToIdent ITChar = Ident "Integer"
488490
489491intTyToClass :: IntTy -> ClassType
490492intTyToClass ty = ClassType [(intTyToIdent ty, [])]
@@ -495,6 +497,7 @@ intTyToMethod (ITFixed IT16) = "shortValue"
495497intTyToMethod (ITFixed IT32) = "intValue"
496498intTyToMethod (ITFixed IT64) = "longValue"
497499intTyToMethod ITNative = "intValue"
500+intTyToMethod ITChar = "intValue"
498501
499502intTyToPrimTy :: IntTy -> PrimType
500503intTyToPrimTy (ITFixed IT8) = ByteT
@@ -502,6 +505,7 @@ intTyToPrimTy (ITFixed IT16) = ShortT
502505intTyToPrimTy (ITFixed IT32) = IntT
503506intTyToPrimTy (ITFixed IT64) = LongT
504507intTyToPrimTy ITNative = IntT
508+intTyToPrimTy ITChar = IntT
505509
506510bigIntegerType :: ClassType
507511bigIntegerType = ClassType [(Ident "BigInteger", [])]
@@ -997,7 +1001,6 @@ mkStringAtIndex var indexExp =
9971001mkForeignType :: FType -> Maybe ClassType
9981002mkForeignType (FArith (ATInt ity)) = return (intTyToClass ity)
9991003mkForeignType (FArith ATFloat) = return doubleType
1000−mkForeignType FChar = return integerType
10011004mkForeignType FString = return stringType
10021005mkForeignType FPtr = return objectType
10031006mkForeignType FAny = return objectType
@@ -1011,7 +1014,7 @@ mkForeignVarAccess (FArith (ATInt ty)) var =
10111014 []
10121015 )
10131016 <$> mkVarAccess (Just $ intTyToClass ty) var
1014−mkForeignVarAccess FChar var = Cast (PrimType CharT) <$> mkForeignVarAccess (FArith (ATInt (ITFixed IT32))) var
1017+-- mkForeignVarAccess (FArith (ATInt ITChar)) var = Cast (PrimType CharT) <$> mkForeignVarAccess (FArith (ATInt (ITFixed IT32))) var
10151018mkForeignVarAccess (FArith ATFloat) var =
10161019 (\ var -> MethodInv $ PrimaryMethodCall (var)
10171020 []
@@ -1022,12 +1025,12 @@ mkForeignVarAccess (FArith ATFloat) var =
10221025mkForeignVarAccess otherType var = mkVarAccess (mkForeignType otherType) var
10231026
10241027mkFromForeignType :: FType -> Exp -> Exp
1025−mkFromForeignType (FArith (ATInt ty)) from =
1028+{-mkFromForeignType (FArith (ATInt ty)) from =
10261029 MethodInv $ TypeMethodCall (J.Name [intTyToIdent ty])
10271030 []
10281031 (Ident "valueOf")
1029− [from]
1030−mkFromForeignType FChar from = mkFromForeignType (FArith (ATInt (ITFixed IT32))) from
1032+ [from] -}
1033+mkFromForeignType (FArith (ATInt ITChar)) from = mkFromForeignType (FArith (ATInt (ITFixed IT32))) from
10311034mkFromForeignType (FArith ATFloat) from =
10321035 MethodInv $ TypeMethodCall (J.Name [Ident "Double"])
10331036 []
@@ -1272,7 +1275,7 @@ mkExp (SConst (Str x)) = return $ Lit $ String x
12721275mkExp (SConst (AType (ATInt ITNative))) = return $ mkClass integerType
12731276mkExp (SConst (AType (ATInt ITBig))) = return $ mkClass bigIntegerType
12741277mkExp (SConst (AType ATFloat)) = return $ mkClass doubleType
1275−mkExp (SConst ChType) = return $ mkClass charType
1278+mkExp (SConst (AType (ATInt ITChar))) = return $ mkClass charType
12761279mkExp (SConst StrType) = return $ mkClass stringType
12771280mkExp (SConst (B8 x)) = return $ mkPrimitive "Byte" (String (show x))
12781281mkExp (SConst (B16 x)) = return $ mkPrimitive "Short" (String (show x))