Debian Codegraph @

Changes

raw
1 Revision history for Function-Parameters
2
3 2.002006 2025-08-16
4 - Fix a parse-time memory leak with undef or default initializers
5 ('fun ($x = undef)' or 'fun ($ =)'). This leak mostly manifests as
6 noise from memory checkers because non-leaked ops aren't freed
7 anyway while perl is still running.
8 - Update bugtracker info in README.
9
10 2.002005 2025-01-19
11 - When debugging (perl -d), skip over invisible (generated) parameter
12 initialization code even if single-step mode is active.
13 - Move repository and bugtracker to <https://codeberg.org>.
14
15 2.002004 2023-07-15
16 - Remove 'perl -T' from tests. This way we can run on perls compiled
17 without support for taint mode. The test didn't actually care about
18 taint anyway.
19
20 2.002003 2023-04-19
21 - Fix line numbers after inlined type checks (gh #42).
22 Previously, the code for type checks was inlined literally, so if a
23 particular check took 5 lines of code, all the following line
24 numbers in the source file would be off by 5 (they would be "pushed
25 down" by the interpolated code). These bad line numbers would show
26 up in error messages from Perl (including warn and die) as well as
27 __LINE__ and caller (and thus stack traces).
28
29 2.002002 2023-04-01
30 - Work around old versions of ExtUtils::MakeMaker not providing
31 is_make_type(), whose version dependency is undocumented (sigh).
32 - Restrict GNU syntax for exporting variables to type 'gmake'; should
33 fix building on BSD, Solaris, etc.
34 - Declare dependency on ExtUtils::MakeMaker 7+ and remove
35 compatibility code for older versions.
36
37 2.002001 2023-04-01
38 - Fix (hopefully) Windows builds using nmake.exe.
39
40 2.002 2023-04-01
41 - Provide //= for default arguments that are also used when the
42 caller passes in undef.
43 - Provide more type combinators in parameter declarations: In
44 addition to | (union types), now ~ & / are also supported (for
45 complement types, intersection types, and alternative types,
46 respectively).
47 - Enable type coercions. If a parameter has a declared type and that
48 type supports coercions ($type->has_coercion returns true), call
49 its ->coerce($value) method to transform arguments before type
50 checking.
51 - Enable inline type checks. If a parameter has a declared type and
52 that type supports inlining ($type->can_be_inlined returns true),
53 its inline code (as provided by ->inline_check('$value')) is baked
54 into the function definition instead of a call to ->check($value).
55 This may speed up type checks.
56 - Move a big chunk of tests to xt/ (author testing only).
57 - Remove xt/ from the distribution.
58 - Enable parallel testing by default (with -j4).
59
60 2.001006 2023-03-27
61 - Work around perl core issue GH#20950 (use re "eval" doesn't capture
62 lexical %^H environment like eval() does and stringifies it
63 instead) by downgrading the previous hard error to a warning (in
64 the new category 'Function::Parameters') and switching
65 Function::Parameters off in the affected scope.
66
67 2.001005 2023-01-27
68 - Fix failures with perl 5.37.5 .. 5.37.6 caused by new internal
69 opcode structure for anonymous subs.
70
71 2.001004 2023-01-20
72 - Drop Dir::Self test dependency (use FindBin instead).
73
74 2.001003 2017-11-11
75 - Fix threaded initialization issue better. This is the same issue
76 that was fixed in 2.001002, but now we use PL_op_mutex instead of
77 PL_check_mutex. This has the advantage of also being thread-safe on
78 v5.14.
79
80 2.001002 2017-11-09
81 - Fix crash when Function::Parameters is loaded at runtime by
82 multiple threads (a stack overflow due to infinite recursion).
83 This is arguably a core bug (RT#132413). The current workaround
84 employed by Function::Parameters slightly abuses an internal perl
85 mutex meant for something else (protecting op checkers), but it
86 fixes the issue on perls v5.16 .. v5.26.
87 v5.14 doesn't have this API yet, so the workaround is not thread
88 safe there. It is technically possible to still run into this issue
89 if two threads initialize Function::Parameters at the exact same
90 moment (I haven't managed to reproduce this yet, so hopefully it's
91 unlikely in practice).
92 It is possible to completely avoid the problem on all versions of
93 perl and Function::Parameters by making sure the module is loaded
94 before the first thread is created.
95
96 2.001001 2017-07-12
97 - fix duplicate type check on invocant:
98 method foo(T $self: $x) { ... }
99 # every call to foo() performs T->check($self) twice
100 - clean up how type errors refer to parameters (now it's
101 "parameter $N" for non-invocant parameters and "invocant $N" for
102 invocants (or just "invocant" if there is exactly one))
103 - rewrite pragma implementation and the way %^H is used
104 - remove several internal package variables
105
106 2.000007 2017-05-15
107 - no real code changes
108 - extend bug RT#129090 workaround to perl 5.25.5
109 - try to detect broken Moose installs earlier
110 - fix declaration of developer dependencies
111
112 2.000006 2017-04-16
113 - work around core bug RT#129090 / RT#131146 in perl 5.22 and 5.24:
114 perl -e 'use Function::Parameters; \&f; fun f() { eval "" }' hangs
115 in the compiler (also happens with perl -d or Devel::Cover instead
116 of eval) (gh #29)
117
118 2.000003 2017-03-31
119 - fix a bug where method modifiers would inadvertently declare subs
120 (e.g. 'before foo() {}' acting like 'sub foo;
121 BEGIN { &before('foo', sub {}) }'), breaking Pkg->can($method) and
122 thus Class::Method::Modifiers (RT #120804)
123 - make method modifiers take effect at runtime because otherwise
124 you'd have to wrap every with()/extends() in a BEGIN block to make
125 consumed/inherited methods visible to modifiers (RT #120804)
126 - make method modifiers require a name (what would an anonymous
127 modifier modify?)
128 - (hopefully) improve the error message you get for trying to add any
129 parameters after a slurpy
130
131 2.000002 2017-03-27
132 - default to strict mode
133 - allow types with multiple arguments (e.g. 'Tuple[Int, String]')
134 - implement new 'auto' type reifier and use it by default
135 - allow multiple invocants
136 - support custom installers
137 - implement Moo/Moose-style method modifiers
138 - rework and extend import syntax
139 - make implicit $self available in default arguments
140 - call type reifiers from correct package and remove 2nd arg
141 workaround
142 - remove :(...) prototype syntax
143 - remove undocumented 'attrs' option
144 - drop internal Moo dependency
145
146 1.0706 2017-03-17
147 - don't require . in @INC during install
148 - improve internal code generation functions used on perls before
149 5.22
150
151 1.0705 2016-06-11
152 - simplify internals
153
154 1.0704 2016-02-13
155 - guard against broken Mooses in Makefile.PL
156 - remove last internal use of glob()
157
158 1.0703 2016-01-05
159 - fix line numbers in runtime errors caused by calls with bad
160 arguments
161 (Carp trying to be smart and skipping over "internal" callers)
162
163 1.0702 2015-12-21
164 - fix parsing of _ in prototypes
165 (caused bogus "Illegal character after '_' in prototype" warnings)
166
167 1.0701 2015-12-04
168 - remove old "bare" import syntax:
169 use Function::Parameters 'foo', 'bar';
170 # equivalent to
171 # use Function::Parameters { foo => 'function', bar => 'method' };
172 (marked as deprecated in 0.06, no longer documented since 1.00)
173
174 1.0605 2015-04-26
175 - update metacpan links
176 - remove wonky test
177
178 1.0604 2015-04-22
179 - new explicit "lax" mode
180 - fix info() with taint mode on (gh pr #12)
181 - don't hide syntax errors that are followed by a parameter list with
182 types (gh #15)
183 - compatibility with perl v5.21.11 (#103843)
184
185 1.0603 2014-11-25
186 - some documentation changes
187 - compatibility with perl development versions
188
189 1.0602 2014-10-21
190 - fix warnings under perl5.21 (causes harmless test failure)
191
192 1.0601 2014-10-20
193 - allow nameless parameters for arguments that should be ignored
194 - fix string comparison bug (":lvaluefoobar" treated as ":lvalue",
195 etc)
196 - explicitly disallow $_/@_/%_ as parameters
197 - change "Not enough" to "Too few" in error message to match perl
198 - don't parse $#foo as a sigil plus comment
199 - remove implicitly optional parameters ("fun foo($x = 42, $y)" used
200 to be equivalent to "fun foo($x = 42, $y = undef)")
201
202 1.0503 2014-10-17
203 - skip initializing parameters if the default argument is undef
204 (don't generate '$x = undef if @_ < 1' for 'fun ($x = undef)')
205
206 1.0502 2014-10-16
207 - fix bug that prevents building with threaded perls
208
209 1.0501 2014-10-13
210 - support :prototype(...) for setting the prototype
211 - allow fun foo($x =, $y =) (empty default arg equivalent to
212 specifying undef)
213
214 1.0404 2014-10-13
215 - fix segfault on 'fun foo(A[[' (malformed type)
216
217 1.0403 2014-10-12
218 - general overhaul for 5.18 and 5.20 support
219 - be more flexible about strict 'vars' error message in tests
220 (#99100)
221
222 1.0402 2014-09-01
223 - fix #92871: don't access dead stack frames on error
224 - fix #95803: don't dereference NULL
225
226 1.0401 2013-10-09
227 - enable type checks by default
228
229 1.0301 2013-09-16
230 - support 'defaults' to base keywords on existing keyword types
231 - 'check_argument_count' no longer controls type checks
232 - new 'check_argument_types' property controls type checks
233 - new 'strict' property does what 'check_argument_count' used to
234 - new 'runtime' property lets you define functions at runtime
235 - some more tests
236
237 1.0202 2013-08-28
238 - make t/foreign/Fun/name.t less fragile to support newer Carp
239 - support older Moo without ->meta support
240
241 1.0201 2013-08-13
242 - custom (per-keyword) type reification
243 - actually use documented defaults for custom keywords
244
245 1.0104 2013-06-16
246 - support unicode in custom keywords
247 - actually validate default attributes
248
249 1.0103 2013-06-09
250 - properly allow non-moose-based custom type constraints (#85851)
251
252 1.0102 2013-03-08
253 - prepare for internals changes in the upcoming 5.18 release
254 (https://rt.cpan.org/Ticket/Display.html?id=83439)
255 - only allocate memory after recognizing a keyword like 'fun'
256 (might speed up parsing a little)
257
258 1.0101 2013-02-05
259 - new reflection API to inspect parameter information of functions
260 - Moose types in parameter lists
261 - more tests
262
263 1.0004 2012-11-26
264 - fix test relying on hash ordering
265
266 1.0003 2012-11-19
267 - clean up internals
268 - fix build errors on some platforms
269 - fix module metadata
270 - some more tests
271
272 1.00 2012-11-01
273 - add named parameters with ':$foo, :$bar' syntax
274 - rewrite documentation
275 - more tests (some of them copied from similar modules on CPAN)
276
277 0.10 2012-10-21
278 - add ':strict' import target
279 - support $invocant: parameter syntax
280
281 0.09 2012-10-14
282 - fix wrong line number for statement immediately following a
283 function
284
285 0.08 2012-07-19
286 - support UTF-8 in function/parameter names
287 - better detection of invalid prototypes
288
289 0.07 2012-06-25
290 - completely rework internals to generate optrees directly
291 (no more generating/reparsing source)
292 - simplify / fewer dependencies
293 - new feature: default arguments (on by default)
294 - new feature: strict argument count checks (off by default)
295 enabled by "*_strict" variants of symbolic types
296
297 0.06 2012-06-19
298 - complete rewrite in XS
299 - require perl 5.14+
300 - hopefully fix bug where it would get the line numbers wrong
301 - we're a lexical pragma now; remove import_into()
302 - more fine-grained control over behavior of generated keywords:
303 * function name can be optional/required/prohibited
304 * invocant name can be any variable, not just $self
305 * default attributes (and method now defaults to ':method')
306
307 0.05 2011-08-02
308 - complete rewrite
309 - hopefully fix bug where it would swallow compilation errors or get
310 the line numbers wrong
311 - method keyword!
312 - more flexible keyword customization
313
314 0.04 2010-03-03
315 - allow renaming the function keyword
316 - provide import_into so you can mess with other packages
317
318 0.03 2009-12-14
319 First version, released on an unsuspecting world.
320