Граф коммитов

57709 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun cda5745c1b
Automatically detect missing symbols
which are usually optimized away by -O3.

This CI can detect missing exports like
ea84a68075 which was needed for
761346a960.
2019-09-01 16:31:15 +09:00
Kazuki Tsujimoto ea84a68075
Export rb_const_source_location_at for MJIT 2019-09-01 16:25:01 +09:00
Yusuke Endoh 02dfa0f163 test/ruby/test_keyword.rb: Add remove_method before method redefinition
to suppress redefinition warnings.
2019-09-01 15:24:37 +09:00
Yusuke Endoh 84dca8eff0 Revert "Skip BUGs on Solaris"
This reverts commit 8adefd4cf2.

I couldn't see any failure on Solaris if the guard is removed.
Give it a try.
2019-09-01 15:16:19 +09:00
Jeremy Evans d646a292cd Fix keyword argument separation warning when using send
vm_call_opt_send was dropping VM_CALL_KW_SPLAT, so this just makes
it not drop it, to get the same behavior as calling the method
directly.
2019-08-31 23:06:49 -07:00
Takashi Kokubun e13c0bb820
Note about ANYARGS in NEWS
Since 50f5a0a8d6, some C++ extensions
needed fixes like https://github.com/eagletmt/faml/pull/49 to make their
build succeed.

Thus it's worth noting that C API declarations are changed.
2019-09-01 15:00:27 +09:00
Jeremy Evans 15757390ff Don't pass an empty keyword hash when double splatting empty hash when calling cfunc
This mirrors earlier changes in keyword argument separation for
calling Ruby methods and calling procs/lambdas, so that behavior
is kept the same.
2019-08-31 21:54:06 -07:00
Nobuyoshi Nakada e80a6f65c8
Made :nil static ID 2019-09-01 13:37:28 +09:00
aycabta e5dd63ba8c IRB 1.1.0.pre.3 2019-09-01 11:23:58 +09:00
aycabta 11d6094cbe Reline 0.0.2 2019-09-01 11:23:52 +09:00
aycabta c5bb074fe7 Re-calculate state variables of screen when screen size changes 2019-09-01 11:02:58 +09:00
Hiroshi SHIBATA 1756ec2065
Ignore the all of warnings with inline_spec.rb of bundler examples. 2019-09-01 08:56:00 +09:00
git a060629e66 * 2019-09-01 [ci skip] 2019-09-01 01:56:24 +09:00
Nobuyoshi Nakada 431a99b556
Split warning messages for tag-jump 2019-09-01 01:52:48 +09:00
aycabta d4eef04883 Use double splat for keyword args by a hash object in lib/un.rb 2019-08-31 20:55:35 +09:00
Takashi Kokubun 602fbd4338
Limit the apt addon enablement to trusty
8897fa60fd worked.
But we want to retry that part and this commit is trying to fix the
problem.
2019-08-31 17:34:25 +09:00
Takashi Kokubun 8897fa60fd
Try using built-in apt source for gcc-8
58a373e9ed and
3868df8333
didn't work.
2019-08-31 17:18:59 +09:00
Takashi Kokubun 3868df8333
Try to fix apt-get update error for trusty (take 2)
https://travis-ci.org/ruby/ruby/jobs/579116510
2019-08-31 17:05:53 +09:00
Takashi Kokubun 58a373e9ed
Try to suppress errors in BASERUBY Travis
https://travis-ci.org/ruby/ruby/jobs/579108692
2019-08-31 16:44:44 +09:00
Jeremy Evans 1f18b578ce Don't pass an empty keyword hash when double splatting empty hash 2019-08-30 23:50:50 -07:00
卜部昌平 4868ad7e5b fix CI failures in x64-mingw32
For insatnce
https://ci.appveyor.com/project/ruby/ruby/builds/27086475/job/mb9whkiygemlfy93
2019-08-31 15:30:10 +09:00
Nobuyoshi Nakada d7aa1260b6
Remove files/directories for git/github which are committed [ci skip] 2019-08-31 14:45:57 +09:00
Jeremy Evans 60a08d9a6c Add rb_iseq_location
This wraps iseq_location and should fix the leaked global test.
2019-08-30 22:11:00 -07:00
Jeremy Evans ec6206a81a Use more accurate source location in keyword argument separation warnings
This shows locations in places it didn't before, such as for
proc calls, and fixes the location for super calls.

This requires making iseq_location non-static and MJIT exported,
which I hope will not cause problems.
2019-08-30 21:56:50 -07:00
Jeremy Evans 3463e83192 Warn for keyword to last hash parameter when method has no optional/rest parameters
Previously, there was no warning in this case, even though we will
be changing the behavior in Ruby 3.

Fixes [Bug #14130]
2019-08-30 19:25:46 -07:00
Jeremy Evans 6424d316b9 Remove a verbose warning that is no longer needed
This warns about a case that we will continue to support.
2019-08-30 17:34:18 -07:00
Yusuke Endoh 8cb9efbbe6 tool/rbinstall.rb: remove a keyword-argument warning 2019-08-31 07:17:46 +09:00
Yusuke Endoh a1e588d1a7 NEWS: Hash-to-keywords automatic conversion is now warned
A follow up for 16c6984bb9..b5b3afadfa.  [Feature #14183]
2019-08-31 07:03:27 +09:00
git 38e08db48e * 2019-08-31 [ci skip] 2019-08-31 04:39:56 +09:00
Jeremy Evans b5b3afadfa Fix a couple of bundler issues with keyword argument separation
There are more issues than this, but hopefully this is enough
to get make test-bundler passing in CI.
2019-08-30 12:39:31 -07:00
Jeremy Evans 856bb3c35d Fix remaining warning issues in the tests due to keyword argument separation 2019-08-30 12:39:31 -07:00
Jeremy Evans 42adc5bc6b Add back missing warning for duplicate keys in splatted hashes
This reverts the changes to parse.y in
a5b37262524ac39d2af13eea174486370a581c23 as they are not actually
needed and cause the warning for duplicate hash keys to not be
emitted.
2019-08-30 12:39:31 -07:00
Jeremy Evans a810f6cbef Update specs to handle non-Symbols for keyword splats in 2.7
Also handle some warnings for behavior that will change in 3.0.
2019-08-30 12:39:31 -07:00
Jeremy Evans 16cd0de6ec When splitting a keyword hash, dup it first to not mutate it 2019-08-30 12:39:31 -07:00
Jeremy Evans 5c507db467 Implement keyword argument to last positional hash emulation
For methods that accept keyword arguments but do not accept a
keyword splat, if a keyword splat is passed, or keywords are
used with a non-symbol key, check the hash.  If the hash contains
all symbols, keep the same behavior as before.  If the hash
contains all non-symbols, move the hash to the last positional
hash and warn. If the hash contains symbols and non-Symbols, split
the hash and use the symbol keys for the keyword hash and non-symbol
keys for the positional hash and warn.
2019-08-30 12:39:31 -07:00
Jeremy Evans 8399609e5a Make keyword_hash_split static 2019-08-30 12:39:31 -07:00
Jeremy Evans 3a23b71f0a Make Method/Proc#parameters handle **nil syntax
Use a [:nokey] entry in this case.
2019-08-30 12:39:31 -07:00
Jeremy Evans fa41a7b260 Make RubyVM::AbstractSyntaxTree handle **nil syntax
Use false instead of nil for the keyword and keyword rest values
in that case.
2019-08-30 12:39:31 -07:00
Jeremy Evans 4d64693c70 Make ripper support **nil syntax
The on_params hook will use :nil as the keyword rest argument.
There is a new on_nokw_param hook as well.

This fixes a type issue in the previous code, where an ID was
passed where a VALUE was the declared type.  The symbol :nil is
passed instead of the id.
2019-08-30 12:39:31 -07:00
Jeremy Evans 6a9ce1fea8 Support **nil syntax for specifying a method does not accept keyword arguments
This syntax means the method should be treated as a method that
uses keyword arguments, but no specific keyword arguments are
supported, and therefore calling the method with keyword arguments
will raise an ArgumentError.  It is still allowed to double splat
an empty hash when calling the method, as that does not pass
any keyword arguments.
2019-08-30 12:39:31 -07:00
Jeremy Evans afae8555da Set symbol export for rb_hash_stlike_foreach
This fixes MJIT after rb_hash_stlike_foreach used vm_args.c.
2019-08-30 12:39:31 -07:00
Jeremy Evans 896e42d93f Restore splitting of hashes into positional and keyword arguments, add warning
This restores compatibility with Ruby 2.6, splitting the last
positional hash into positional and keyword arguments if it
contains both symbol and non-symbol keys.  However, in this case
it will warn, as the behavior in Ruby 3 will be to not split the
hash and keep it as a positional argument.

This does not affect the handling of mixed symbol and non-symbol
keys in bare keywords.  Those are still treated as keywords now,
as they were before this patch.  This results in different
behavior than Ruby 2.6, which would split the bare keywords and
use the non-Symbol keys as a positional arguments.
2019-08-30 12:39:31 -07:00
Jeremy Evans 15bca0d4d3 Fix test after keyword argument separation
Now that keyword splats accept non-Symbols, the type of exception
changes.

Previously, a TypeError (hash key "k1" is not a Symbol) was raised
for this test, but now an ArgumentError (unknown keyword: "k1") is
raised.
2019-08-30 12:39:31 -07:00
Jeremy Evans 03697ddf63 Update tests to fix warning message changes
Now that keyword splats accept non-Symbols, the inspect value of
the keyword is used instead of the string value.
2019-08-30 12:39:31 -07:00
Jeremy Evans 9c2e165f7d Only promote last hash to keyword if all keys are symbols
If all keys are not symbols, then the non-symbol keys would not
be treated as keywords in previous versions.  It doesn't make
sense to treat these hashes as keywords to break compatibility and
warn about behavior changes in Ruby 2.7 when the Ruby 3.0 behavior
will be the same as the Ruby 2.6 for these hashes.
2019-08-30 12:39:31 -07:00
Jeremy Evans e0b4599bba Fix keyword argument separation warnings in test 2019-08-30 12:39:31 -07:00
Jeremy Evans d08e1004e0 Fix keyword argument separation issues in lib
Mostly requires adding ** in either calls or method definitions.
2019-08-30 12:39:31 -07:00
Jeremy Evans 3f67fcd3d5 Fix hash to keyword warning to apply in all cases
Previously, it only applied if the call had more positional
arguments than the method it was calling accepted.
2019-08-30 12:39:31 -07:00
Jeremy Evans 334b41a46b Allow ** syntax to be used for calling methods that do not accept keywords
Treat the ** syntax as passing a copy of the hash as the last
positional argument.  If the hash being double splatted is empty, do
not add a positional argument.

Remove rb_no_keyword_hash, no longer needed.
2019-08-30 12:39:31 -07:00
Yusuke Endoh 16c6984bb9 Separate keyword arguments from positional arguments
And, allow non-symbol keys as a keyword arugment
2019-08-30 12:39:31 -07:00