@jakubklos
You do not specify a {$mode} in your project or units, which means they default to mode fpc (not objfpc, or delphi), which is probably not what you want.
Perhaps the compilation problem arises from a weakness in generics syntax somewhere (this is just a guess) or your combination of generics and interfaces, which probes more recent compiler changes and either exposes a bug, or requires a stricter syntax adherence on your part. The compiler's inability to flag a more specific compilation error, or pin-point an offending source line is obviously unhelpful.
Perhaps to get line number information you will have to build the FPC RTL with debug information?