During type resolution, do not REPLACE the type with it's resolved type.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 06 Jul 2015 08:03:53 +0100
changeset 38 7654e5bd9818
parent 37 1ad7fb72801a
child 39 5ff8fcdb5228
During type resolution, do not REPLACE the type with it's resolved type. Rather link it, i.e., set UDT's type to resolved type. Let the mappings to handle the rest if necessary.
Cface__TypeResolver.st
--- a/Cface__TypeResolver.st	Mon Jul 06 07:52:34 2015 +0100
+++ b/Cface__TypeResolver.st	Mon Jul 06 08:03:53 2015 +0100
@@ -38,15 +38,6 @@
 
 !TypeResolver methodsFor:'visiting'!
 
-visit: aCNode
-
-    super visit: aCNode.
-    (aCNode respondsTo: #type) ifTrue:
-        [aCNode type: aCNode type resolved]
-
-    "Created: / 17-02-2008 / 17:56:42 / janfrog"
-!
-
 visitCTypedefNode: anObject
 
     anObject type isCUserDefinedTypeNode ifTrue:[
@@ -63,20 +54,20 @@
 !
 
 visitCUserDefinedTypeNode: anObject
-
     "/thisContext isRecursive ifTrue:[^self].
 
+    anObject type isNil ifTrue:[
+        |type|
 
-    anObject type 
-        ifNil:
-            [|type|
-            type := (typeMap at: anObject cName ifAbsent:[CPointerNode new type: CVoidNode new]).
-            self visit: type.
-            anObject type: type]
+        type := (typeMap at: anObject cName ifAbsent:[CPointerNode new type: CVoidNode new]).
+        self visit: type.
+        anObject type: type
+    ]
 
     "Created: / 12-02-2008 / 23:45:17 / janfrog"
     "Modified: / 17-02-2008 / 18:30:56 / janfrog"
     "Modified: / 09-07-2008 / 20:53:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 06-07-2015 / 08:01:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !TypeResolver class methodsFor:'documentation'!