@@ -99,10 +99,14 @@ const void generic_parameter_specialization_map_keyst::insert_pairs_for_pointer(
99
99
pointer_type.subtype ().get (ID_identifier) ==
100
100
pointer_subtype_struct.get (ID_name));
101
101
102
- // If the pointer points to an incomplete class, don't treat the generics
103
- // TODO TG-1996 should treat generic incomplete (mocked) classes
104
- // Also do not treat generics is the class is not marked generic or
105
- // implicitly generic (this may be due to unsupported class signature)
102
+ // If the pointer points to:
103
+ // - an incomplete class or
104
+ // - a class that is neither generic nor implicitly generic (this
105
+ // may be due to unsupported class signature)
106
+ // then ignore the generic types in the pointer and do not add any pairs.
107
+ // TODO TG-1996 should decide how mocking and generics should work
108
+ // together. Currently an incomplete class is never marked as generic. If
109
+ // this changes in TG-1996 then the condition below should be updated.
106
110
if (
107
111
!pointer_subtype_struct.get_bool (ID_incomplete_class) &&
108
112
(is_java_generic_class_type (pointer_subtype_struct) ||
@@ -137,10 +141,14 @@ const void generic_parameter_specialization_map_keyst::insert_pairs_for_symbol(
137
141
const symbol_typet &symbol_type,
138
142
const typet &symbol_struct)
139
143
{
140
- // If the class is an incomplete class, don't treat the generics
141
- // TODO TG-1996 should treat generic incomplete (mocked) classes
142
- // Also do not treat generics is the class is not marked generic or
143
- // implicitly generic (this may be due to unsupported class signature)
144
+ // If the struct is:
145
+ // - an incomplete class or
146
+ // - a class that is neither generic nor implicitly generic (this
147
+ // may be due to unsupported class signature)
148
+ // then ignore the generic types in the symbol_type and do not add any pairs.
149
+ // TODO TG-1996 should decide how mocking and generics should work
150
+ // together. Currently an incomplete class is never marked as generic. If
151
+ // this changes in TG-1996 then the condition below should be updated.
144
152
if (
145
153
is_java_generic_symbol_type (symbol_type) &&
146
154
!symbol_struct.get_bool (ID_incomplete_class) &&
0 commit comments