Skip to content

incomplete between parameter type annotation and default value, but no error is reported. #61627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
frokaikan opened this issue Apr 28, 2025 · 2 comments
Closed
1 task done
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@frokaikan
Copy link

Acknowledgement

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

Comment

code:

interface I { }
class J { }
function X(arg1: number, arg2?: number, arg3: J = new J(), arg4?: I): number | null { return null; }
(arg1: number, arg2?: number, arg3: J = 11.33, arg4?: I): number | null => { return null; }

the arg3 in the lambda expression has type J, but its default value is a number. However, typescript engine gives no error.

The version of tsc is 5.8.3

@MartinJohns
Copy link
Contributor

Please use the bug report issue template for bug reports, or the feature request issue template for feature requests.


This is working as intended and mentioned in the FAQ:

@RyanCavanaugh RyanCavanaugh added the Working as Intended The behavior described is the intended behavior; this is not a bug label Apr 28, 2025
@typescript-bot
Copy link
Collaborator

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

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
Projects
None yet
Development

No branches or pull requests

4 participants