X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=hs-java.git;a=blobdiff_plain;f=JVM%2FClassFile.hs;fp=JVM%2FClassFile.hs;h=217e7bcfc7afc6a128a13da1518da0ce3f683be7;hp=e30eb27abf13ede87d9653c9b5f9af4da38ca082;hb=312938f1af414da6443d21246e51a55e4457a885;hpb=4d1941510b85901ccfd7eaf94c56c13e7cfc1c20 diff --git a/JVM/ClassFile.hs b/JVM/ClassFile.hs index e30eb27..217e7bc 100644 --- a/JVM/ClassFile.hs +++ b/JVM/ClassFile.hs @@ -147,11 +147,11 @@ class (Binary (Signature a), Show (Signature a), Eq (Signature a)) => HasSignature a where type Signature a -instance HasSignature Field where - type Signature Field = FieldSignature +instance HasSignature (Field Direct) where + type Signature (Field Direct) = FieldSignature -instance HasSignature Method where - type Signature Method = MethodSignature +instance HasSignature (Method Direct) where + type Signature (Method Direct) = MethodSignature -- | Name and signature pair. Used for methods and fields. data NameType a = NameType { @@ -171,9 +171,9 @@ instance HasSignature a => Binary (NameType a) where -- | Constant pool item data Constant stage = CClass (Link stage B.ByteString) - | CField (Link stage B.ByteString) (Link stage (NameType Field)) - | CMethod (Link stage B.ByteString) (Link stage (NameType Method)) - | CIfaceMethod (Link stage B.ByteString) (Link stage (NameType Method)) + | CField (Link stage B.ByteString) (Link stage (NameType (Field stage))) + | CMethod (Link stage B.ByteString) (Link stage (NameType (Method stage))) + | CIfaceMethod (Link stage B.ByteString) (Link stage (NameType (Method stage))) | CString (Link stage B.ByteString) | CInteger Word32 | CFloat Float @@ -557,7 +557,7 @@ lookupField name cls = look (classFields cls) | fieldName f == name = Just f | otherwise = look fs -fieldNameType :: Field Direct -> NameType Field +fieldNameType :: Field Direct -> NameType (Field Direct) fieldNameType f = NameType (fieldName f) (fieldSignature f) instance Binary (Field File) where @@ -589,7 +589,7 @@ deriving instance Eq (Method Direct) deriving instance Show (Method File) deriving instance Show (Method Direct) -methodNameType :: Method Direct -> NameType Method +methodNameType :: Method Direct -> NameType (Method Direct) methodNameType m = NameType (methodName m) (methodSignature m) lookupMethod :: B.ByteString -> Class Direct -> Maybe (Method Direct)