예제 #1
0
 def test_return_nothing_on_nonvoid(self):
     util.assert_compile_fails(
         "resources/types_method_types/return_nothing_on_nonvoid.slg",
         "Can't return nothing from a method unless the method returns void"
     )
예제 #2
0
 def test_generic_member_method(self):
     path = util.assert_compile_fails(
         "resources/generic_methods/generic_member_method.slg",
         message="Member methods cannot have type arguments")
예제 #3
0
 def test_instantiate_raw_type(self):
     util.assert_compile_fails(
         "resources/generic_classes/instantiate_raw_type.slg",
         message="Expected type arguments")
예제 #4
0
 def test_method_not_implemented(self):
     path = util.assert_compile_fails(
         "resources/interfaces/method_not_implemented.slg",
         message=
         "Method 'method2' of interface 'Interface' is not implemented by class 'Class'"
     )
예제 #5
0
 def test_unsatisfied_extends_bound(self):
     path = util.assert_compile_fails(
         "resources/generic_methods/unsatisfied_extends_bound.slg",
         message=
         "Could not reify generic method: ':stdlib.Object' does not satisfy ':T extends stdlib.String'"
     )
예제 #6
0
 def test_assign_to_supercall_statement(self):
     path = util.assert_compile_fails(
         "resources/supercalls/assign_to_supercall_statement.slg",
         message="Cannot assign to a method call")
예제 #7
0
 def test_dont_override_abstract_method(self):
     path = util.assert_compile_fails(
         "resources/abstract_classes/dont_override_abstract_method.slg",
         message="is not overridden")
예제 #8
0
 def test_equality_needs_assignable(self):
     util.assert_compile_fails(
         "resources/types_wrong_operator_types/equality_needs_assignable.slg",
         "Incomparable types")
예제 #9
0
 def test_if_needs_boolean(self):
     util.assert_compile_fails(
         "resources/types_wrong_operator_types/if_needs_boolean.slg",
         "must be boolean")
예제 #10
0
 def test_arithmetic_oneint(self):
     util.assert_compile_fails(
         "resources/types_wrong_operator_types/arithmetic_oneint.slg",
         "is not numerical")
예제 #11
0
 def test_equality_makes_boolean(self):
     util.assert_compile_fails(
         "resources/types_wrong_operator_types/equality_makes_boolean.slg",
         "is not numerical")
예제 #12
0
 def test_int_as_bool(self):
     util.assert_compile_fails(
         "resources/types_wrong_explicit_type/bool_as_int.slg",
         "not assignable")
예제 #13
0
 def test_no_return_on_nonvoid(self):
     path = util.assert_compile_fails(
         "resources/types_method_types/no_return_on_nonvoid.slg",
         "Non-void method might not return")
예제 #14
0
 def test_return_something_on_void(self):
     util.assert_compile_fails(
         "resources/types_method_types/return_something_on_void.slg",
         "Return type mismatch")
예제 #15
0
 def test_inheritance_duplicate_field_different_type(self):
     path = util.assert_compile_fails(
         "resources/inheritance/duplicate_field_different_type.slg",
         message=
         "Duplicate field in both child and parent class named 'number'")
예제 #16
0
 def test_increment_bool(self):
     util.assert_compile_fails(
         "resources/types_wrong_operator_types/increment_bool.slg",
         "to increment something that isn't numerical")
예제 #17
0
 def test_inheritance_duplicate_field_different_type(self):
     path = util.assert_compile_fails(
         "resources/methods/override_outside_class.slg",
         message=
         "Can't both be an override method and not have a containing class")
예제 #18
0
 def test_inplace_with_bool(self):
     util.assert_compile_fails(
         "resources/types_wrong_operator_types/inplace_with_bool.slg",
         "must be numerical")
예제 #19
0
 def test_instantiate_abstract_class(self):
     path = util.assert_compile_fails(
         "resources/abstract_classes/instantiate_abstract_class.slg",
         message="Cannot instantiate an abstract class")
예제 #20
0
 def test_arrays_literal_of_nulls(self):
     util.assert_compile_fails(
         "resources/arrays/literla_of_nulls.slg",
         "Cannot have an array literal comprising only null values, use arbitrary-length instantiation syntax instead"
     )
예제 #21
0
 def test_supercall_to_abstract_method(self):
     path = util.assert_compile_fails(
         "resources/abstract_classes/supercall_to_abstract_method.slg",
         message="Attempt to perform super call to abstract method")
예제 #22
0
 def test_arrays_no_such_member_type(self):
     util.assert_compile_fails("resources/arrays/no_such_member_type.slg",
                               "Could not resolve type")
예제 #23
0
 def test_wrong_return_type_void(self):
     path = util.assert_compile_fails(
         "resources/interfaces/wrong_return_type_void.slg",
         message=
         "Method 'method' of class 'Class' has return type :void that isn't assignable to return type :int of the corresponding method from interface Interface"
     )
예제 #24
0
 def test_inheritance_overriding_override_on_parent(self):
     path = util.assert_compile_fails(
         "resources/inheritance/overriding_override_on_parent.slg",
         message="overriding rules")
예제 #25
0
 def test_unsatisfied_implements_bound(self):
     path = util.assert_compile_fails(
         "resources/generic_methods/unsatisfied_implements_bound.slg",
         message=
         "Could not reify generic method: ':stdlib.Object' does not satisfy ':T implements stdlib.Hashable, stdlib.ToString, Interface'"
     )
예제 #26
0
 def test_inheritance_overriding_no_corresponding(self):
     path = util.assert_compile_fails(
         "resources/inheritance/overriding_no_corresponding.slg",
         message="overriding rules")
예제 #27
0
 def test_type_annotation_raw_type(self):
     util.assert_compile_fails(
         "resources/generic_classes/type_annotation_raw_type.slg",
         message="Cannot use raw types directly")
예제 #28
0
 def test_inheritance_overriding_mismatched_arguments(self):
     path = util.assert_compile_fails(
         "resources/inheritance/overriding_mismatched_arguments.slg",
         message="overriding rules")
예제 #29
0
 def test_not_assignable(self):
     util.assert_compile_fails(
         "resources/generic_classes/not_assignable.slg",
         message="is not assignable to")
예제 #30
0
 def test_wrong_return_type(self):
     util.assert_compile_fails(
         "resources/types_method_types/wrong_return_type.slg",
         "Return type mismatch")