diff --git a/src/elvis_style.erl b/src/elvis_style.erl index 5329914..e1442e3 100644 --- a/src/elvis_style.erl +++ b/src/elvis_style.erl @@ -1834,7 +1834,9 @@ has_state_record(Root) -> -spec has_state_type(ktn_code:tree_node()) -> boolean(). has_state_type(Root) -> IsStateType = - fun(Node) -> (type_attr == ktn_code:type(Node)) and (state == ktn_code:attr(name, Node)) + fun(Node) -> + TypeOrOpaque = (type_attr == ktn_code:type(Node)) or (opaque == ktn_code:type(Node)), + TypeOrOpaque and (state == ktn_code:attr(name, Node)) end, elvis_code:find(IsStateType, Root) /= [].