Community
Participate
Working Groups
The AssertableDiagnostics class defines some public static methods that can be used to create DiagnosticsPredicates (e.g. errorCode()). However, all these public methods return Pred classes that is protected. In general, this seems erroneous. In my case, it prevented me from using Xtend to feed assertAll() with multiple errorCode() predicates, as Xtend did not allow me to avoid referencing the non-visible Pred classes.
I created a branch in Github that fixes this issue by changing the return type of the public static methods to the available DiagnosticPredicate interface. This change should be compatible with all previous uses; however will not leak the Pred classes. My commit with the fix is available from https://github.com/ujhelyiz/xtext/commit/9dfe5413156296f47dc3264eb46c6572357cea8d
see also bug 374743
I think we would have to make the nested class public if we don't want to break binary compatibility as in the proposed commit. Overloading the methods is unfortunately not an alternative as the signatures (apart from the return type) remain identical. Any thoughts on this?
agreed and pushed.
Requested via bug 522520. -M.