@@ -1,5 +1,9 @@
2020-XX-XX 4.1.4:
+ General improvements:
+
+ all : allowed `Any` as type parameter in `catch(e:SomeType<Any>)` (#9641)
Bugfixes:
php : fixed false detection of `catch` vars in anonymous functions as captured from outer scope
@@ -1877,7 +1877,7 @@ and type_try ctx e1 catches with_type p =
in
let check_catch_type_params params =
List.iter (fun pt ->
- if pt != t_dynamic then error "Catch class parameter must be Dynamic" p;
+ if Abstract.follow_with_abstracts pt != t_dynamic then error "Catch class parameter must be Dynamic" p;
) params
let catches,el = List.fold_left (fun (acc1,acc2) ((v,pv),t,e_ast,pc) ->
@@ -0,0 +1,13 @@
+package unit.issues;
+class Issue9641 extends unit.Test {
+ function test() {
+ try {
+ throw new MyException<Int>('');
+ } catch(e:MyException<Any>) {
+ noAssert();
+ }
+}
+private class MyException<T> extends haxe.Exception {}