fix(language-core): drop undefined from type of optional prop with default in template #5339 
   Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.    
 
Currently, Optional prop with default may incorrectly be undefined in template when
exactOptionalPropertyTypesandstrictNullChecksare true: #5338Here is a Playground link to explore the change: Vue SFC Playground
(The same thing can be seen when compiling locally, and I can provide a full repository if it would help. I don't know how to apply the patch to the VSCode extension/IDE, so I've only been able to test it when running
vue-tsc)While looking into the issue I reported above, I noticed that the
__VLS_WithDefaultstype inlanguage-core/lib/codegen/localTypes.tswould still keep a prop as possibly undefined even if a default value was provided. This would be visible when trying to access that prop in the template, where a typescript error would be thrown because it believes the prop could possibly be undefined. The error would not show up if accessing the prop through the props object, only when referencing it directly. See the issue for more informationThis is my first time diving into internal Vue code, so please let me know if there's anything I should do differently!