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

[vim9class] incorrect type checking modifying list in class from outside class #15090

Open
errael opened this issue Jun 24, 2024 · 0 comments · May be fixed by #15094
Open

[vim9class] incorrect type checking modifying list in class from outside class #15090

errael opened this issue Jun 24, 2024 · 0 comments · May be fixed by #15094
Labels
bug vim9class Vim 9 Class Functionality

Comments

@errael
Copy link
Contributor

errael commented Jun 24, 2024

Steps to reproduce

Run

vim9script

class Conflict
    var l: list<string> = []
endclass

var o = Conflict.new()
echo o.l->add(123)

and see output

[123]

Expected behaviour

Should get an error like

E1013: Argument 2: type mismatch, expected string but got number

Version of Vim

9.1.516

Environment

linux/gtk3

Logs and stack traces

No response

@errael errael added the bug label Jun 24, 2024
@zeertzjq zeertzjq added the vim9class Vim 9 Class Functionality label Jun 24, 2024
LemonBoy added a commit to LemonBoy/vim that referenced this issue Jun 24, 2024
Ensure the generated typevals get the declared type and generate
typechecks to ensure that's the case.

Closes vim#15090
@LemonBoy LemonBoy linked a pull request Jun 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug vim9class Vim 9 Class Functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants