Skip to content

Typescript development problem: Is specialized knowledge required to solve fourslash errors? #56283

Closed as not planned

Description

Acknowledgement

  • I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.

Comment

I have a pull #56281 which involves changing src/lib/rs5.d.ts.
I think because it changes that file, there are a few fourslash errors similar to this one:

         fourslash tests
           tests/cases/fourslash/completionListInTypeParameterOfClassExpression1.ts
             fourslash test completionListInTypeParameterOfClassExpression1.ts runs correctly:
     AssertionError: At marker "4": expected [ 'D', 'any', 'Array', …(138) ] to deeply equal [ 'D', 'any', 'Array', …(137) ]
      at _TestState.verifyCompletionsAreExactly (src/harness/fourslashImpl.ts:1213:16)
      at _TestState.verifyCompletionsWorker (src/harness/fourslashImpl.ts:1074:18)
      at _TestState.verifyCompletions (src/harness/fourslashImpl.ts:1009:25)
      at Verify.completions (src/harness/fourslashInterfaceImpl.ts:251:31)
      at eval (completionListInTypeParameterOfClassExpression1.js:8:8)
      at runCode (src/harness/fourslashImpl.ts:4607:9)
      at runFourSlashTestContent (src/harness/fourslashImpl.ts:4565:5)
      at runFourSlashTest (src/harness/fourslashImpl.ts:4548:5)
      at Context.<anonymous> (src/testRunner/fourslashRunner.ts:60:39)
      at processImmediate (node:internal/timers:478:21)

They don't go away after hereby baseline-accept.
Does this require changing the LKG?
Otherwise, how to inspect the differences and modify the baseline?

Activity

  1. jakebailey commented on Nov 1, 2023

    @jakebailey
    Member

    If you read the test case, you'll see it mention globalTypesPlus, which depends on

    const globalTypeDecls: readonly ExpectedCompletionEntryObject[] = [
    and would need to be updated. Most (nearly all) PRs do not modify the globals in such a way that this hardcoded list changes.

  2. jakebailey commented on Nov 1, 2023

    @jakebailey
    Member

    However, needing to modify this may indicate that something is wrong with the PR (which I have not read; I am not sure anything has changed to make filter(Boolean) any more acceptable than before).

  3. craigphicks commented on Nov 1, 2023

    @craigphicks
    Author

    However, needing to modify this may indicate that something is wrong with the PR (which I have not read; I am not sure anything has changed to make filter(Boolean) any more acceptable than before).

    I had added a BooleanConverter interface which has only the conversion with no constructor, to use as filter predicate. The idea being to be as specific as possible. However, based on your advice about the cost of changing globals, which I agree with, I have removed it now, and it is using BooleanConstructor without issue.

  4. typescript-bot commented on Nov 4, 2023

    @typescript-bot
    Contributor

    This issue has been marked as "Question" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

  5. locked as resolved and limited conversation to collaborators on Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions