Bram Moolenaar
e1d1211799
patch 8.2.4509: Vim9: can declare a variable with ":va"
...
Problem: Vim9: can declare a variable with ":va".
Solution: Disallow using ":va", require using ":var".
2022-03-05 11:37:48 +00:00
Bram Moolenaar
0e1574c406
patch 8.2.4500: Vim9: can declare a global variable on the command line
...
Problem: Vim9: can declare a global variable on the command line.
Solution: Disallow declaring a variable on the command line. (closes #9881 )
2022-03-03 17:05:35 +00:00
Bram Moolenaar
1983f1aa31
patch 8.2.4484: Vim9: some error messages are not tested
...
Problem: Vim9: some error messages are not tested.
Solution: Add a few more test cases. Delete dead code.
2022-02-28 20:55:02 +00:00
Bram Moolenaar
afa048f0d4
patch 8.2.4447: Vim9: can still use s:var in a compiled function
...
Problem: Vim9: can still use s:var in a compiled function.
Solution: Disallow using s:var for Vim9 script. (closes #9824 )
2022-02-22 20:43:36 +00:00
Bram Moolenaar
0c7f2610de
patch 8.2.4410: Vim9: some code not covered by tests
...
Problem: Vim9: some code not covered by tests.
Solution: Add a few more tests. Remove dead code.
2022-02-17 19:44:07 +00:00
Bram Moolenaar
6296d1e60e
patch 8.2.4409: Vim9: some code not covered by tests
...
Problem: Vim9: some code not covered by tests.
Solution: Add a few more tests. Fix reported line number.
2022-02-17 16:30:11 +00:00
Bram Moolenaar
ea5c898b5f
patch 8.2.4408: Vim9: some code not covered by tests
...
Problem: Vim9: some code not covered by tests.
Solution: Add a few more tests. Correct error message. Allow unlet on dict
with a number key.
2022-02-17 14:42:02 +00:00
Bram Moolenaar
e08be09a08
patch 8.2.4407: Vim9: some code not covered by tests
...
Problem: Vim9: some code not covered by tests.
Solution: Add more tests. Avoid giving two errors. Remove dead code.
2022-02-17 13:08:26 +00:00
Bram Moolenaar
8b716f5f22
patch 8.2.4395: some code lines not covered by tests
...
Problem: Some code lines not covered by tests.
Solution: Add a few more test cases. Fix getting more than one error for
invalid assignment.
2022-02-15 21:17:56 +00:00
Bram Moolenaar
e88c6b7a5d
patch 8.2.4390: Vim9: list from declaration with inferred type not set
...
Problem: Vim9: list from declaration with inferred type does not set the
type on the value.
Solution: When inferring the type in a variable declaration also set the
type of the list or dictionary. (closes #9705 ) Do not set the
type when the member is "any".
2022-02-15 15:37:11 +00:00
Bram Moolenaar
bc51006402
patch 8.2.4384: Vim9: error message not tested, some code not tested
...
Problem: Vim9: error message not tested, some code not tested.
Solution: Add a couple of test cases. Give an error for a command modifier
without a command.
2022-02-14 21:19:04 +00:00
Bram Moolenaar
a749a42ed2
patch 8.2.4360: Vim9: allowing use of "s:" leads to inconsistencies
...
Problem: Vim9: allowing use of "s:" leads to inconsistencies.
Solution: Disallow using "s:" in Vim9 script at the script level.
2022-02-12 19:52:25 +00:00
Bram Moolenaar
160afdb185
patch 8.2.4311: Vim9: changing script variable type not caught compile time
...
Problem: Vim9: changing script variable type not caught at compile time.
Solution: Set the declared type.
2022-02-06 17:17:02 +00:00
Bram Moolenaar
83d0cec956
patch 8.2.4296: Vim9: not all code covered by tests
...
Problem: Vim9: not all code covered by tests.
Solution: Add a few more tests for corner cases. Fix hang when single quote
is missing.
2022-02-04 21:17:58 +00:00
Bram Moolenaar
2d3ac2e030
patch 8.2.4287: cannot assign empty list with type to variable with list type
...
Problem: Cannot assign empty list with any list type to variable with
specific list type.
Solution: Use unknown list type for empty list if the specified type is any.
2022-02-03 12:34:05 +00:00
Bram Moolenaar
381692b6f1
patch 8.2.4286: Vim9: strict type checking after copy() and deepcopy()
...
Problem: Vim9: strict type checking after copy() and deepcopy().
Solution: Allow type to change after making a copy. (closes #9644 )
2022-02-02 20:01:27 +00:00
Bram Moolenaar
848faddb87
patch 8.2.4260: Vim9: can still use a global function without g:
...
Problem: Vim9: can still use a global function without g: at the script
level.
Solution: Also check for g: at the script level. (issue #9637 )
2022-01-30 15:28:30 +00:00
Bram Moolenaar
62aec93bfd
patch 8.2.4257: Vim9: finding global function without g: prefix inconsistent
...
Problem: Vim9: finding global function without g: prefix but not finding
global variable is inconsistent.
Solution: Require using g: for a global function. Change the vim9.vim
script into a Vim9 script with exports. Fix that import in legacy
script does not work.
2022-01-29 21:45:34 +00:00
Bram Moolenaar
35c807df1f
patch 8.2.4231: Vim9: map() gives type error when type was not declared
...
Problem: Vim9: map() gives type error when type was not declared.
Solution: Only check the type when it was declared, like extend() does.
(closes #9635 )
2022-01-27 16:36:29 +00:00
Bram Moolenaar
38ecd97226
patch 8.2.4103: Vim9: variable declared in for loop not initialzed
...
Problem: Vim9: variable declared in for loop not initialzed.
Solution: Always initialze the variable. (closes #9535 )
2022-01-15 21:44:44 +00:00
Bram Moolenaar
d5f400c607
patch 8.2.4019: Vim9: import mechanism is too complicated
...
Problem: Vim9: import mechanism is too complicated.
Solution: Do not use the Javascript mechanism but a much simpler one.
2022-01-06 21:10:28 +00:00
Bram Moolenaar
c653e4a2bd
patch 8.2.4006: Vim9: crash when declaring variable on the command line
...
Problem: Vim9: crash when declaring variable on the command line.
Solution: Use a temporary type list. (closes #9474 )
2022-01-05 10:16:30 +00:00
Bram Moolenaar
078a46161e
patch 8.2.3996: Vim9: type checking lacks information about declared type
...
Problem: Vim9: type checking for list and dict lacks information about
declared type.
Solution: Add dv_decl_type and lv_decl_type. Refactor the type stack to
store two types in each entry.
2022-01-04 15:17:03 +00:00
Bram Moolenaar
114dbda785
patch 8.2.3991: Vim9: error when extending dict<any>
...
Problem: Vim9: error when extending dict<any> with another type that it was
initialized with.
Solution: Also set the type for dict<any> if the initializer has a more
specific type. (closes #9461 )
2022-01-03 12:28:03 +00:00
Bram Moolenaar
9a015111a5
patch 8.2.3954: Vim9: no error for shadowing if script var is declared later
...
Problem: Vim9: no error for shadowing if script var is declared later.
Solution: Check argument names when compiling a function.
2021-12-31 14:06:45 +00:00
Bram Moolenaar
13789bf103
patch 8.2.3945: Vim9: partial variable argument types are wrong
...
Problem: Vim9: partial variable argument types are wrong, leading to a
crash.
Solution: When adjusting the argument count also adjust the argument types.
(closes #9433 )
2021-12-30 13:29:00 +00:00
Bram Moolenaar
86b3ab4fa0
patch 8.2.3854: Vim9: inconsistent arguments for test functions
...
Problem: Vim9: inconsistent arguments for test functions.
Solution: When :def function and script have different arguments use a list
with two items instead of a separate function.
2021-12-19 18:33:23 +00:00
Bram Moolenaar
44a8977de4
patch 8.2.3844: Vim9: no type error if assigning func(number) to func(string)
...
Problem: Vim9: no type error if assigning a value with type func(number) to
a variable of type func(string).
Solution: Use check_type_maybe(): return MAYBE if a runtime type check is
useful. (issue #8492 )
2021-12-18 12:31:33 +00:00
Bram Moolenaar
71b7685092
patch 8.2.3841: Vim9: outdated TODO items, disabled tests that work
...
Problem: Vim9: outdated TODO items, disabled tests that work.
Solution: Remove TODO items, run tests that work now. Check that a dict
item isn't locked.
2021-12-17 20:15:38 +00:00
Bram Moolenaar
db9ff9ab5d
patch 8.2.3717: Vim9: error for constant list size is only given at runtime
...
Problem: Vim9: error for constant list size is only given at runtime.
Solution: Give the error at compile time if possible.
2021-12-01 17:38:01 +00:00
Bram Moolenaar
ab36e6ae7b
patch 8.2.3704: Vim9: cannot use a list declaration in a :def function
...
Problem: Vim9: cannot use a list declaration in a :def function.
Solution: Make it work.
2021-11-30 16:14:49 +00:00
Bram Moolenaar
7f2c341664
patch 8.2.3696: Vim9: error for invalid assignment when skipping
...
Problem: Vim9: error for invalid assignment when skipping.
Solution: Do not check white space when skipping. (closes #9243 )
2021-11-29 16:01:49 +00:00
Bram Moolenaar
7824fc80f6
patch 8.2.3682: Vim9: assigning to a script variable drops the type
...
Problem: Vim9: assigning to a script variable drops the required type.
Solution: Lookup the type of the variable and use it. (closes #9219 )
2021-11-26 17:36:51 +00:00
Bram Moolenaar
07802044b9
patch 8.2.3423: Vim9: list += list creates a new list in :def function
...
Problem: Vim9: list += list creates a new list in :def function.
Solution: Append to the existing list.
2021-09-09 23:01:14 +02:00
Bram Moolenaar
60faf8656e
patch 8.2.3370: Vim9: no check for white space before type in declaration
...
Problem: Vim9: no check for white space before type in declaration.
(Naohiro Ono)
Solution: Check for white space like in a compiled function. (closes #8785 )
2021-08-23 22:22:45 +02:00
Bram Moolenaar
4f0884d6e2
patch 8.2.3332: Vim9: cannot assign to range in list
...
Problem: Vim9: cannot assign to range in list.
Solution: Implement overwriting a list range.
2021-08-11 21:49:23 +02:00
Bram Moolenaar
4270d8b762
patch 8.2.3310: Vim9: unpack assignment does not mention source of type error
...
Problem: Vim9: unpack assignment does not mention source of type error.
Solution: Mention the argument number. (closes #8719 )
2021-08-07 16:30:42 +02:00
Bram Moolenaar
af647e76ca
patch 8.2.3296: Vim9: cannot add a number to a float
...
Problem: Vim9: cannot add a number to a float.
Solution: Accept a number if the destination is a float. (closes #8703 )
2021-08-05 19:01:17 +02:00
Bram Moolenaar
23e2e11515
patch 8.2.3281: Vim9: TODO items in tests can be taken care of
...
Problem: Vim9: TODO items in tests can be taken care of.
Solution: Update test for now working functionality. (closes #8694 )
2021-08-03 21:16:18 +02:00
Bram Moolenaar
7bf9a07bd7
patch 8.2.3278: Vim9: error when adding 1 to float
...
Problem: Vim9: error when adding 1 to float.
Solution: Accept t_number_bool. (closes #8687 )
2021-08-02 21:55:15 +02:00
Bram Moolenaar
e97976baa7
patch 8.2.3266: Vim9: assignment with two indexes may check next line
...
Problem: Vim9: assignment with two indexes may check next line.
Solution: Limit the number of lines to avoid checking the next line when
assiging to a LHS subscript. (closes #8660 )
2021-08-01 13:17:17 +02:00
Bram Moolenaar
f5d52c90e0
patch 8.2.3263: Vim9: "..=" does not accept same types as the ".." operator
...
Problem: Vim9: "..=" does not accept same types as the ".." operator.
Solution: Convert value to string like ".." does. (issue #8664 )
2021-07-31 22:51:10 +02:00
Bram Moolenaar
81530e3603
patch 8.2.3239: Vim9: no error using heredoc for a number variable
...
Problem: Vim9: no error using heredoc for a number variable.
Solution: Add a type check. (closes #8627 )
2021-07-28 21:25:49 +02:00
Bram Moolenaar
327d3ee455
patch 8.2.3237: when a builtin function gives an error processing continues
...
Problem: When a builtin function gives an error processing continues.
Solution: In Vim9 script return FAIL in get_func_tv().
2021-07-28 19:34:14 +02:00
Bram Moolenaar
47bc9c3337
patch 8.2.3174: Vim9: "legacy undo" finds "undo" variable
...
Problem: Vim9: "legacy undo" finds "undo" variable.
Solution: Do not pass lookup function to find_ex_command(). (closes #8563 )
2021-07-17 21:24:56 +02:00
Bram Moolenaar
378697ac58
patch 8.2.3168: Vim9: type error for constant of type any
...
Problem: Vim9: type error for constant of type any.
Solution: Do add a runtime type check if a constant has type any.
(closes #8570 )
2021-07-15 19:23:18 +02:00
Bram Moolenaar
22f85d0459
patch 8.2.3107: Vim9: error for arguments while type didn't specify arguments
...
Problem: Vim9: error for arguments while type didn't specify arguments.
Solution: Do not update that type to check when no argument count is
specified. (closes #8492 )
2021-07-04 23:29:30 +02:00
Bram Moolenaar
6977dba04b
patch 8.2.3106: Vim9: confusing line number reported for error
...
Problem: Vim9: confusing line number reported for error.
Solution: Use the start line number for the store instruction.
(closes #8488 )
2021-07-04 22:48:12 +02:00
Bram Moolenaar
97f227d9c9
patch 8.2.3105: Vim9: type of partial is wrong when it has arguments
...
Problem: Vim9: type of partial is wrong when it has arguments.
Solution: Subtract arguments from the count. (issue #8492 )
2021-07-04 20:20:52 +02:00
Bram Moolenaar
b7480cd893
patch 8.2.3104: Vim9: unspecified function type causes type error
...
Problem: Vim9: unspecified function type causes type error.
Solution: Don't check type when min_argcount is negative. (issue #8492 )
2021-07-04 18:28:15 +02:00