Skip to content

[isolatedDeclarations][5.5] Optional parameter annotated with imported type has isolatedDeclarations errorΒ #58647

Closed
@MichaelMitchell-at

Description

@MichaelMitchell-at

πŸ”Ž Search Terms

isolated declarations optional import error explicit type annotation

πŸ•— Version & Regression Information

  • This changed between versions 5.5.0-dev.20240517 and 5.5.0-dev.20240524

⏯ Playground Link

https://www.typescriptlang.org/dev/bug-workbench/?target=7&isolatedDeclarations=true&all=true&noCheck=true&emitDeclarationOnly=true&ts=5.5.0-dev.20240524#code/PTAEAEGcBcCcEsDG0Bco4FcCmAoEEATLRAGwENYzp4B7AOzU133HkhvOiwIBFjzK1epEaxseMOCwBbeND6kKVWnQDydEgE9R4lmRIkaAdwBSI0ADN9kZpLo0AwgAtiAax22IkJ8YCis6AkvHyN-OS4CADF4Eiw0MgA6AgToSBwg8AsYrDoyaTjQRNT0+GkABxpYaFAAb3RNMqxQSJoaUABfS1gaaVAAcgIaLEgAWntoEawADzZoPoBudOmKqtBEYWqyUABeUAAKCgBzAH40FpoASjQANxp4Ah2APlr2nGXK6osMOmQVUAAjA6wE5nVpXUC3e4vIA

πŸ’» Code

// @strict: true
// @declaration: true
// @isolatedDeclarations: true
// @emitDeclarationOnly: true
// @allowJs: false
// @noCheck: true
// @showEmit
// @showEmittedFile: a.d.ts

// @filename: a.ts

import { type Foo } from 'does-not-exist';

export const a = (arg?: Foo): void => {}
export function b(arg?: Foo): void {}

Workbench Repro

πŸ™ Actual behavior

arg has Parameter must have an explicit type annotation with --isolatedDeclarations.(9011)

πŸ™‚ Expected behavior

No errors

Additional information about the issue

This only seems to happen if the import path doesn't exist. cc @weswigham @dragomirtitian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions