Skip to content

[#1755] Fix Polymorphism errors look strange in LSP

Melwyn Saldanha requested to merge fix/lsp/strage_poly_errors into dev

Motivation and Context


The error pretty-printers/formatter we different in case of json & dev. This causes difference in printed error messages between CLI & LSP diagnostics


Unify/Extract the common bits between the different pp functions, in order to have the same error message in CLI & LSP


Fixes #1755 (closed)



  • compiler
  • website
  • webide
  • vscode-plugin
  • debugger

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement (non-breaking change that improves performance)
  • None (change with no changelog)


Fixes the difference in error messages between CLI & LSP dianostics. Now the type error messages will be consistent across CLI & LSP.


  • Changes follow the existing coding style (use dune @fmt to check).
  • Tests for the changes have been added (for bug fixes / feature).
  • Documentation has been updated.
  • Changelog description has been added (if appropriate).
  • Start titles under ## Changelog section with #### (if appropriate).
  • There is no image or uploaded file in changelog
  • Examples in changed behaviour have been added to the changelog (for breaking change / feature).
Edited by Melwyn Saldanha

Merge request reports