diff --git a/spec/declaration/record_function_spec.lua b/spec/declaration/record_function_spec.lua index 75bd616f5..79b81cb64 100644 --- a/spec/declaration/record_function_spec.lua +++ b/spec/declaration/record_function_spec.lua @@ -94,6 +94,26 @@ describe("record function", function() { y = 5, msg = "different number of input arguments: got 2, expected 3" }, })) + pending("detect mismatch in function generics", util.check_type_error([[ + local type List2 = record + new: function(initialItems: {T}, u: U): List2 + end + + function List2.new(initialItems: {T}, u: U): List2 -- mismatched return type + end + + local type Fruit2 = enum + "apple" + "peach" + "banana" + end + + local type L2 = List2 + local lunchbox = L2.new({"apple", "peach"}, true) + ]], { + { msg = "type signature does not match declaration" } + })) + it("report error in return args correctly (regression test for #618)", util.check_warnings([[ local record R _current: R