Sorry this repro is a bit long, but I couldn't reduce it any further. It's something about the presence of all the elements in this example that triggers the incorrect errors, and also the order seems to matter.
The error persists in the file until I restart the language server.
Change line 4 from | Step : ('a -> 'b)... to | Step : string * ('a -> 'b)...
Fix up the rest of the code: ( @> ), exec_with_profile, then sum_file_sizes
Expected
No errros
Actual
At line 28 (the recursive base case of exec_with_profile), 2 errors appear.
Empty
Empty should be of type ('a, 'a) pipeline.
However, it is identified as (string list, string list) pipeline, and it is underlined with this error:
This pattern matches values of type (string list, string list) pipeline
but a pattern was expected which matches values of type
(input, output) pipeline
The type constructor output would escape its scope (ocamllsp)
input
input should be of the locally abstract type input, but it seems to be string list, if I'm reading the error correctly.
This is the error:
This expression has type input = string list
but an expression was expected of type output
This instance of string list is ambiguous:
it would escape the scope of its equation (ocamllsp)
I trimmed the recording just to where the error first appears, which is when I still have a few things to fix up, but even after the code compiles, the 2 errors persist.
Sorry this repro is a bit long, but I couldn't reduce it any further. It's something about the presence of all the elements in this example that triggers the incorrect errors, and also the order seems to matter.
The error persists in the file until I restart the language server.
Steps
(libraries core core_unix core_unix.sys_unix)
| Step : ('a -> 'b)...
to| Step : string * ('a -> 'b)...
( @> )
,exec_with_profile
, thensum_file_sizes
Expected
No errros
Actual
At line 28 (the recursive base case of
exec_with_profile
), 2 errors appear.Empty
Empty
should be of type('a, 'a) pipeline
.However, it is identified as
(string list, string list) pipeline
, and it is underlined with this error:This pattern matches values of type
(string list, string list) pipeline
but a pattern was expected which matches values of type(input, output) pipeline
The type constructoroutput
would escape its scope (ocamllsp)input
input
should be of the locally abstract typeinput
, but it seems to bestring list
, if I'm reading the error correctly.This is the error:
This expression has type
input = string list
but an expression was expected of typeoutput
This instance ofstring list
is ambiguous: it would escape the scope of its equation (ocamllsp)I trimmed the recording just to where the error first appears, which is when I still have a few things to fix up, but even after the code compiles, the 2 errors persist.
https://github.com/user-attachments/assets/65172c7d-a2e6-4736-ae4e-cae9bf6237e3