Open MichaelMitchell-at opened 3 hours ago
Based on some other recent issues I was looking at - this should report an error about lack of | undefined
in the annotation.
Based on some other recent issues I was looking at - this should report an error about lack of
| undefined
in the annotation.
Interesting. Why is that so? Is that only when exactOptionalPropertyTypes
is off?
Seems like a bug?
EOPT doesn't have any effect on parameters FWIW
Ah, it might be that the | undefined
is required only when dealing with parameter properties (or however those are called). See https://github.com/microsoft/TypeScript/issues/60123 and https://github.com/microsoft/TypeScript/pull/60129
FWIW, this case here is likely also related to an unresolved type that is actually an error type (a special kind of any
)
๐ Search Terms
explicit type annotation false positive isolated declarations
๐ Version & Regression Information
โฏ Playground Link
https://www.typescriptlang.org/dev/bug-workbench/?target=7&noCheck=true&isolatedDeclarations=true&emitDeclarationOnly=true&ts=5.7.0-dev.20241010#code/PTAEAEGcBcCcEsDG0Bco4FcCmAoEEATLRAGwENYzp4B7AOzU133DpoGEALYga0dmx4w4LAFt40ACLFylavQDydEgE9+glvEg1y0LAWmkKVWnUjrmwsiRI0A7gClzoAGbXIliJE72AouOghLx87fwk9AgAxeBIsNDIAOgIE6EgcIPAXGKw6MlE40ETUnHhRAAcaWGhQAG8AFRUyrABfV1gaUVAAchcaGi6AbnSsAA8KqtBEehhXPtAAXlAACmhGrAB+NAamgEo0ADcaeAIFgD5a5qGgA
๐ป Code
๐ Actual behavior
Error even though type annotation exists
๐ Expected behavior
No error
Additional information about the issue
Sorry, I don't have time at the moment to bisect to the commit that introduced the regression