Bram Moolenaar
c6951a76a5
patch 9.0.1108: type error when using "any" type and adding to float
...
Problem: Type error when using "any" type and adding a number to a float.
Solution: Accept both a number and a float. (closes #11753 )
2022-12-29 20:56:24 +00:00
Bram Moolenaar
56310d38d8
patch 9.0.1104: invalid memory access when checking function argument types
...
Problem: Invalid memory access when checking function argument types.
Solution: Do not check beyond the number of arguments. (closes #11755 )
2022-12-27 17:25:05 +00:00
Bram Moolenaar
74e1274edf
patch 9.0.1054: object member can't get type from initializer
...
Problem: Object member can't get type from initializer.
Solution: If there is no type specified try to use the type of the
initializer. Check for a valid type.
2022-12-13 21:14:28 +00:00
Bram Moolenaar
692fe0889c
patch 9.0.1052: using freed memory on exit when EXITFREE is defined
...
Problem: Using freed memory on exit when EXITFREE is defined.
Solution: Make a deep copy of the type. Make sure TTFLAG_STATIC is not set
in the copy.
2022-12-13 13:42:37 +00:00
Bram Moolenaar
6342e2c5a6
patch 9.0.1050: using freed memory when assigning to variable twice
...
Problem: Using freed memory when assigning to variable twice.
Solution: Make copy of the list type. (closes #11691 )
2022-12-12 18:56:32 +00:00
Bram Moolenaar
ffdaca9e6f
patch 9.0.1041: cannot define a method in a class
...
Problem: Cannot define a method in a class.
Solution: Implement defining an object method. Make calling an object
method work.
2022-12-09 21:41:48 +00:00
Bram Moolenaar
00b28d6c23
patch 9.0.1031: Vim9 class is not implemented yet
...
Problem: Vim9 class is not implemented yet.
Solution: Add very basic class support.
2022-12-08 15:32:33 +00:00
Bram Moolenaar
330d64d32c
patch 9.0.0703: failing check for argument type for const any
...
Problem: Failing check for argument type for const any.
Solution: Check for any type properly. (closes #11316 )
2022-10-09 12:55:33 +01:00
Bram Moolenaar
d0121c63cf
patch 9.0.0628: Coverity warns for not checking return value
...
Problem: Coverity warns for not checking return value.
Solution: Check the return value and simplify the code.
2022-09-30 12:00:06 +01:00
Bram Moolenaar
ac38ec7c7f
patch 9.0.0624: leaking argument type array
...
Problem: Leaking argument type array.
Solution: Add allocated memory to type_gap.
2022-09-29 20:23:35 +01:00
Bram Moolenaar
fa1039760e
patch 9.0.0623: error for modifying a const is not detected at compile time
...
Problem: Error for modifying a const is not detected at compile time.
Solution: Add TTFLAG_CONST and check for it in add() and extend().
2022-09-29 19:14:42 +01:00
Bram Moolenaar
73e28dcc61
patch 9.0.0491: no good reason to build without the float feature
...
Problem: No good reason to build without the float feature.
Solution: Remove configure check for float and "#ifdef FEAT_FLOAT".
2022-09-17 21:08:33 +01:00
Bram Moolenaar
3e8b7a6056
patch 9.0.0477: missing dependency may cause crashes on incomplete build
...
Problem: Missing dependency may cause crashes on incomplete build.
Solution: Add dependency.
2022-09-16 12:28:34 +01:00
Bram Moolenaar
62e0e2e54b
patch 9.0.0229: Vim9: error message for missing type is not clear
...
Problem: Vim9: error message for missing type is not clear.
Solution: Mention the context. (issue #10944 )
2022-08-20 12:07:58 +01:00
Bram Moolenaar
31d9948e3a
patch 8.2.5026: Vim9: a few lines not covered by tests
...
Problem: Vim9: a few lines not covered by tests.
Solution: Delete dead code. Add a few test cases. make "12->func()" work.
2022-05-26 22:24:43 +01:00
Bram Moolenaar
bce69d65dd
patch 8.2.4998: Vim9: crash when using multiple funcref()
...
Problem: Vim9: crash when using multiple funcref().
Solution: Check if varargs type is NULL. (closes #10467 )
2022-05-22 13:45:52 +01:00
Bram Moolenaar
a6c18d38ca
patch 8.2.4657: errors for functions are sometimes hard to read
...
Problem: Errors for functions are sometimes hard to read.
Solution: Use printable_func_name() in more places.
2022-03-31 20:02:56 +01:00
Bram Moolenaar
859cc21c6b
patch 8.2.4642: Vim9: in :def function script var cannot be null
...
Problem: Vim9: in :def function script var cannot be null.
Solution: Only initialize a script variable when not set to a null value.
(closes #10034 )
2022-03-28 15:22:35 +01:00
Bram Moolenaar
badf04f5c2
patch 8.2.4554: Vim9: using null values not sufficiently tested
...
Problem: Vim9: using null values not sufficiently tested.
Solution: Add more tests. Fix uncovered problem.
2022-03-12 21:28:22 +00:00
Bram Moolenaar
ed0c62e7b1
patch 8.2.4529: Vim9: comparing partial with function fails
...
Problem: Vim9: comparing partial with function fails.
Solution: Support this comparison. Avoid a crash. (closes #9909 )
Add more test cases.
2022-03-08 19:43:55 +00:00
Bram Moolenaar
8acb9cc620
patch 8.2.4526: Vim9: cannot set variables to a null value
...
Problem: Vim9: cannot set variables to a null value.
Solution: Add null_list, null_job, etc.
2022-03-08 13:18:55 +00:00
Bram Moolenaar
c2f17f7e64
patch 8.2.4429: using script-local function from the wrong script
...
Problem: Using script-local function from the wrong script when using a
partial. (Yegappan Lakshmanan)
Solution: Include the script ID in the partial name.
2022-02-21 13:13:50 +00:00
Bram Moolenaar
2626d6a71c
patch 8.2.4310: Vim9: constant list and dict get a declaration type
...
Problem: Vim9: constant list and dict get a declaration type other than
"any".
Solution: A constant list and dict have a declared member type "any".
(closes #9701 )
2022-02-06 15:49:35 +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
8133018f50
patch 8.2.4279: Vim9: cannot change item type with map() after range()
...
Problem: Vim9: cannot change item type with map() after range().
Solution: Split the return type in current type and declared type.
(closes #9665 )
2022-02-01 12:11:58 +00:00
Bram Moolenaar
c84287d6d8
patch 8.2.4114: Vim9: type checking for a funcref does not work for method
...
Problem: Vim9: type checking for a funcref does not work for when it is
used in a method.
Solution: Pass the base to where the type is checked.
2022-01-16 18:06:21 +00:00
Bram Moolenaar
d9d2fd0aa3
patch 8.2.4086: "cctx" argument of find_func_even_dead() is unused
...
Problem: "cctx" argument of find_func_even_dead() is unused.
Solution: Remove the argument.
2022-01-13 21:15:21 +00:00
Dominique Pelle
748b308eeb
patch 8.2.4038: various code not used when features are disabled
...
Problem: Various code not used when features are disabled.
Solution: Add #ifdefs. (Dominique Pellé, closes #9491 )
2022-01-08 12:41:16 +00:00
Bram Moolenaar
62a099cc6d
patch 8.2.4034: Coverity warns for possibly using a NULL pointer
...
Problem: Coverity warns for possibly using a NULL pointer.
Solution: Check v_partial is not NULL.
2022-01-07 20:18:16 +00:00
Bram Moolenaar
48824e952f
patch 8.2.3998: asan error for adding zero to NULL
...
Problem: Asan error for adding zero to NULL.
Solution: Do not compute pointer if there are no entries.
2022-01-04 16:05:48 +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
cfe3af284a
patch 8.2.3948: Vim9: failure with partial with unknown argument count
...
Problem: Vim9: failure with partial with unknown argument count.
Solution: Do not copy argument types if there aren't any.
2021-12-30 13:59:20 +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
fa46ead31a
patch 8.2.3869: Vim9: type checking for "any" is inconsistent
...
Problem: Vim9: type checking for "any" is inconsistent.
Solution: Always use a runtime type check for using "any" for a more
specific type.
2021-12-22 13:18:39 +00:00
Bram Moolenaar
1b5f7a6202
patch 8.2.3868: Vim9: function test fails
...
Problem: Vim9: function test fails.
Solution: Add missing changes. Add test for earlier patch.
2021-12-21 13:30:42 +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
e124204c4f
patch 8.2.3830: error messages are spread out
...
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
2021-12-16 20:56:57 +00:00
Bram Moolenaar
464393a696
patch 8.2.3429: leaking memory when assigning to list or dict
...
Problem: Leaking memory when assigning to list or dict.
Solution: Free the list or dict type before overwriting it.
2021-09-11 23:07:44 +02:00
Bram Moolenaar
c8103b4c25
patch 8.2.3382: crash when getting the type of a NULL partial
...
Problem: Crash when getting the type of a NULL partial.
Solution: Check for NULL. (closes #8260 )
2021-08-28 14:58:44 +02:00
Bram Moolenaar
c66f645b80
patch 8.2.3359: Vim9: error for type when variable is not set
...
Problem: Vim9: error for type when variable is not set.
Solution: Give a specific error for a NULL function. (closes #8773 )
2021-08-19 21:08:30 +02:00
Bram Moolenaar
b56c4419d4
patch 8.2.3322: Vim9: checking type of dict does not check member type
...
Problem: Vim9: checking type of dict does not check member type.
Solution: When getting the type of a typval use dv_type and lv_type.
(closes #8732 )
2021-08-09 22:22:27 +02:00
Yegappan Lakshmanan
8ee52affe7
patch 8.2.3320: some local functions are not static
...
Problem: Some local functions are not static.
Solution: Add "static". Move snprintf() related code to strings.c.
(Yegappan Lakshmanan, closes #8734 )
2021-08-09 19:59:06 +02:00
Bram Moolenaar
f78da4f9d6
patch 8.2.3269: Vim9: wrong argument check for partial
...
Problem: Vim9: wrong argument check for partial. (Naohiro Ono)
Solution: Handle getting return type without arguments. Correct the minimal
number of arguments for what is included in the partial.
(closes #8667 )
2021-08-01 15:40:31 +02:00
Bram Moolenaar
60dc8274e9
patch 8.2.3249: Vim9: error for re-imported function with default argument
...
Problem: Vim9: error for re-imported function with default argument.
Solution: Do not check argument type if it is still unknown. (closes #8653 )
2021-07-29 22:48:54 +02:00
Bram Moolenaar
7a3fe3e180
patch 8.2.3200: Vim9: hard to guess where a type error is given
...
Problem: Vim9: hard to guess where a type error is given.
Solution: Add the function name where possible. (closes #8608 )
2021-07-22 14:58:47 +02:00
Bram Moolenaar
9da32e4d57
patch 8.2.3134: crash when using typename() on a function reference
...
Problem: Crash when using typename() on a function reference. (Naohiro Ono)
Solution: Initialize pointer to NULL. (closes #8531 )
2021-07-09 19:53:57 +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