@@ -559,4 +559,68 @@ SCENARIO(
559
559
560
560
// TODO: Check that specialised superclass is created. TG-1418, TG-1419
561
561
}
562
+
563
+ THEN (" There should be a symbol for the `ExtendImplicit` class" )
564
+ {
565
+ std::string class_prefix = " java::GenericBase$ExtendImplicit" ;
566
+ REQUIRE (new_symbol_table.has_symbol (class_prefix));
567
+
568
+ const symbolt &derived_symbol = new_symbol_table.lookup_ref (class_prefix);
569
+ const class_typet &derived_class_type =
570
+ require_type::require_java_implicitly_generic_class (derived_symbol.type );
571
+
572
+ THEN (" The base for superclass is implicitly generic" )
573
+ {
574
+ REQUIRE (derived_class_type.bases ().size () == 1 );
575
+ const typet &base_type = derived_class_type.bases ().at (0 ).type ();
576
+ require_type::require_java_generic_symbol_type (
577
+ base_type,
578
+ " java::GenericBase$ImplicitGeneric" ,
579
+ {{require_type::type_argument_kindt::Var, " java::GenericBase::T" }});
580
+ }
581
+ }
582
+
583
+ THEN (" There should be a symbol for the `ExtendImplicitAndExplicit` class" )
584
+ {
585
+ std::string class_prefix = " java::GenericBase$ExtendImplicitAndExplicit" ;
586
+ REQUIRE (new_symbol_table.has_symbol (class_prefix));
587
+
588
+ const symbolt &derived_symbol = new_symbol_table.lookup_ref (class_prefix);
589
+ const class_typet &derived_class_type =
590
+ require_type::require_java_implicitly_generic_class (derived_symbol.type );
591
+
592
+ THEN (" The base for superclass is generic *and* implicitly generic" )
593
+ {
594
+ REQUIRE (derived_class_type.bases ().size () == 1 );
595
+ const typet &base_type = derived_class_type.bases ().at (0 ).type ();
596
+ require_type::require_java_generic_symbol_type (
597
+ base_type,
598
+ " java::GenericBase$ImplicitAndExplicitGeneric" ,
599
+ {{require_type::type_argument_kindt::Var, " java::GenericBase::T" },
600
+ {require_type::type_argument_kindt::Var,
601
+ " java::GenericBase$ExtendImplicitAndExplicit::S" }});
602
+ }
603
+ }
604
+
605
+ THEN (" There should be a symbol for the `ExtendImplicitAndExplicit` class" )
606
+ {
607
+ std::string class_prefix = " java::GenericBase2$ExtendImplicitAndExplicit" ;
608
+ REQUIRE (new_symbol_table.has_symbol (class_prefix));
609
+
610
+ const symbolt &derived_symbol = new_symbol_table.lookup_ref (class_prefix);
611
+ const class_typet &derived_class_type =
612
+ require_type::require_java_implicitly_generic_class (derived_symbol.type );
613
+
614
+ THEN (" The base for superclass is generic *and* implicitly generic" )
615
+ {
616
+ REQUIRE (derived_class_type.bases ().size () == 1 );
617
+ const typet &base_type = derived_class_type.bases ().at (0 ).type ();
618
+ require_type::require_java_generic_symbol_type (
619
+ base_type,
620
+ " java::GenericBase2$ImplicitAndExplicitGeneric" ,
621
+ {{require_type::type_argument_kindt::Var, " java::GenericBase2::T" },
622
+ {require_type::type_argument_kindt::Var, " java::GenericBase2::S" },
623
+ {require_type::type_argument_kindt::Var, " java::GenericBase2::S" }});
624
+ }
625
+ }
562
626
}
0 commit comments