Skip to content
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

Assignment incorrectly flagged as invalid #356

Open
dstoc opened this issue May 10, 2024 · 0 comments
Open

Assignment incorrectly flagged as invalid #356

dstoc opened this issue May 10, 2024 · 0 comments

Comments

@dstoc
Copy link

dstoc commented May 10, 2024

Repro:

import {LitElement, html} from 'lit';
import {customElement, property} from 'lit/decorators.js';

interface A {
  a: number;
}

interface B {
  b: number;
}

@customElement('test-element')
export class Test extends LitElement {
  @property({attribute: false}) prop?: A & B;
  override render() {
    return html` <test-element .prop=${this.prop!}></test-element> `;
  }
}

Error:

    Type 'A & B' is not assignable to 'A & B | undefined'
    16:  n html` <test-element .prop=${this.prop!}></test-e
    no-incompatible-type-binding

[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant