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

Error when using method notation (->) on multiple lines #11723

Closed
lifepillar opened this issue Dec 18, 2022 · 1 comment
Closed

Error when using method notation (->) on multiple lines #11723

lifepillar opened this issue Dec 18, 2022 · 1 comment
Labels

Comments

@lifepillar
Copy link
Contributor

lifepillar commented Dec 18, 2022

Edit: use a much simpler example.

Steps to reproduce

  1. Create lib.vim with the following content:
vim9script

export def Noop(n: number): number
  return n
enddef
  1. Source the following script:
vim9script

import "./lib.vim" as lib

const x = 1

var result = lib.Noop(x)->lib.Noop()->lib.Noop()  # OK

result = lib.Noop(x)
          ->lib.Noop()->lib.Noop()  # OK

result = lib.Noop(x)
      ->lib.Noop()
      ->lib.Noop()  # ERROR

Result:

E1013: Argument 1: type mismatch, expected number but got func(number): number

Expected behaviour

The script should execute without errors, as per :help vim9-line-continuation:

For a method call using "->" and a member using a dot, a line break is allowed before it

Version of Vim

9.0.1065

Environment

OS: macOS 13.1
Terminal: Apple Terminal
$TERM: xterm-256color
Shell: ZSH

Logs and stack traces

No response

@lifepillar lifepillar added the bug label Dec 18, 2022
@lifepillar
Copy link
Contributor Author

This also fails:

result = lib.Noop(x)->lib.Noop()
	->lib.Noop()

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

No branches or pull requests

1 participant