-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
@vue-expect-error does not seem to work in the language-tools tsc tests #4203
Comments
You should use |
I can't figure out how to debug this, how do you get it to print the generated typescript? edit: nvm I figured it out, this is the generated typescript: const foo = {};
let __VLS_modelEmitsType!: {};
const __VLS_componentsOption = {};
let __VLS_name!: 'main';
function __VLS_template() {
let __VLS_ctx!: InstanceType<__VLS_PickNotAny<typeof __VLS_internalComponent, new () => {}>> & {
};
/* Components */
let __VLS_otherComponents!: NonNullable<typeof __VLS_internalComponent extends { components: infer C } ? C : {}> & typeof __VLS_componentsOption;
let __VLS_own!: __VLS_SelfComponent<typeof __VLS_name, typeof __VLS_internalComponent & (new () => { $scopedSlots: typeof __VLS_slots })>;
let __VLS_localComponents!: typeof __VLS_otherComponents & Omit<typeof __VLS_own, keyof typeof __VLS_otherComponents>;
let __VLS_components!: typeof __VLS_localComponents & __VLS_GlobalComponents & typeof __VLS_ctx;
/* Style Scoped */
type __VLS_StyleScopedClasses = {};
let __VLS_styleScopedClasses!: __VLS_StyleScopedClasses | keyof __VLS_StyleScopedClasses | (keyof __VLS_StyleScopedClasses)[];
/* CSS variable injection */
/* CSS variable injection end */
let __VLS_resolvedLocalAndGlobalComponents!: {}
;
__VLS_intrinsicElements.div;__VLS_intrinsicElements.div;
{
const __VLS_0 = __VLS_intrinsicElements["div"];
const __VLS_1 = __VLS_elementAsFunctionalComponent(__VLS_0);
const __VLS_2 = __VLS_1({ ...{ }, ...(__VLS_ctx.foo), }, ...__VLS_functionalComponentArgsRest(__VLS_1));
({} as (props: __VLS_FunctionalComponentProps<typeof __VLS_0, typeof __VLS_2> & Record<string, unknown>) => void)({ ...{ }, ...(__VLS_ctx.foo), });
// @ts-expect-error __VLS_TS_EXPECT_ERROR
;
const __VLS_3 = __VLS_pickFunctionalComponentCtx(__VLS_0, __VLS_2)!;
}
if (typeof __VLS_styleScopedClasses === 'object' && !Array.isArray(__VLS_styleScopedClasses)) {
}
var __VLS_slots!:{
};
// @ts-ignore
[foo,foo,];
return __VLS_slots;
}
const __VLS_internalComponent = (await import('vue')).defineComponent({
setup() {
return {
foo: foo as typeof foo,
};
},
});
export default (await import('vue')).defineComponent({
setup() {
return {
};
},
});
type __VLS_IntrinsicElementsCompletion = __VLS_IntrinsicElements; Notice how there's an errant semicolon before the line that I suppose does the reading of the variable. My editor does warn it's unused though, so at least the test suite should have picked up, I don't know why it doesn't: Removing the semicolon makes it properly pick up the error on the next line if there is an error, so that's at least messing with things. |
Cool! Seemed to be a bug. |
I'm sorry I'm having a lot of trouble debugging this. In the tsc package it says:
But if I add Do you have any pointers to how to debug things in this project? |
I suppose I missed the build step. Still awkward that I can't figure out where the results of the build step actually go, but I guess that's a mystery for the ages. I did figure out that this was already broken in v2.0.0. Now I'm struggling to get v1.8.7 to build. |
Ok I don't know why I struggled with that at first, but |
Alright,
But that's a huge commit so I don't think it's much help unfortunately. Maybe @johnsoncodehk has a tip? |
For example in the file
test-workspace/tsc/vue3/v-bind-require-object/main.vue
the code is:To expect that
foo = 1
makes the tsc fail. The error is succesfully repressed, so that works well. However if you change the code tofoo = {}
, like so:Then I would expect the test suite to fail because of there no longer being an error. Instead neither vscode, nor running:
Gives any error.
If I remove the
<!-- @vue-expect-error -->
then the code properly typechecks withfoo = {}
and properly fails withfoo = 1
.The text was updated successfully, but these errors were encountered: