From e6f637e4b291e85fd3a190aa566de1ad0688a3b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Tue, 8 Dec 2020 17:44:37 +0100 Subject: [PATCH] Add regression test for #23 --- test/ex_type/checker_test_case.ex | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/ex_type/checker_test_case.ex b/test/ex_type/checker_test_case.ex index 7c18633..4d7c167 100644 --- a/test/ex_type/checker_test_case.ex +++ b/test/ex_type/checker_test_case.ex @@ -38,4 +38,21 @@ defmodule ExType.CheckerTestCase do def test_case_3 do 23 end + + # Regression test for https://github.com/gyson/ex_type/issues/23 + defmodule Nested do + @enforce_keys [:nested] + defstruct @enforce_keys + + @type t(nested) :: %Nested{ + nested: nested + } + end + + # FIXME Would be great to have your input how you want to name test cases :) + @spec get_nested(Nested.t(nested)) :: nested when nested: any() + + def get_nested(%Nested{nested: nested}) do + nested + end end