Skip to content

Inconsistent behavior between tsc and tsgo for @ts-expect-error directive placement #1088

Open
@cartond

Description

@cartond

There appears to be an inconsistency in how tsc and tsgo handle the placement of @ts-expect-error directives when dealing with TS2769 (No overload matches this call) errors.

import { reduce } from 'lodash';

export function foo(state: any) {
	// tsc is happy with @ts-expect-error here
	// @ts-expect-error FIXME (TS2769)  No overload matches this call.; Remove this comment to see full error message
	return reduce(
		{ foo: 'bar' },
		(fuzz: number) => {
			return fuzz;
		},
		// tsgo is happy with @ts-expect-error here
		{}
	);
}

Repo to see the error with: https://github.com/cartond/tsgo-ts-expect-err-repro

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Type CheckingRelated to type checking, grammar checking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions