Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:19
erlang
2353-stdlib-Warn-for-bad-type-variables-of-para...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2353-stdlib-Warn-for-bad-type-variables-of-parameterized-.patch of Package erlang
From 838dde1e27ee6a6debf74cf2370b2284f618b348 Mon Sep 17 00:00:00 2001 From: Hans Bolinder <hasse@erlang.org> Date: Wed, 17 May 2017 14:08:49 +0200 Subject: [PATCH] stdlib: Warn for bad type variables of parameterized types The linter emits warnings about using '_' as type variable in parameterized types. --- lib/stdlib/src/erl_parse.yrl | 3 +++ lib/stdlib/test/erl_lint_SUITE.erl | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl index 2dcddeb8c..733932e71 100644 --- a/lib/stdlib/src/erl_parse.yrl +++ b/lib/stdlib/src/erl_parse.yrl @@ -1052,6 +1052,9 @@ build_typed_attribute({atom,Aa,record}, build_typed_attribute({atom,Aa,Attr}, {type_def, {call,_,{atom,_,TypeName},Args}, Type}) when Attr =:= 'type' ; Attr =:= 'opaque' -> + lists:foreach(fun({var, A, '_'}) -> ret_err(A, "bad type variable"); + (_) -> ok + end, Args), case lists:all(fun({var, _, _}) -> true; (_) -> false end, Args) of -- 2.13.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor