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

Enumerator's Yielder does not pass through one-elt array properly #4108

Closed
headius opened this issue Aug 24, 2016 · 4 comments
Closed

Enumerator's Yielder does not pass through one-elt array properly #4108

headius opened this issue Aug 24, 2016 · 4 comments

Comments

@headius
Copy link
Member

@headius headius commented Aug 24, 2016

This is the continuation of #3814.

See the discussion there for the long form.

Short form, the following script should produce the given result. Two fail as shown by specs in #3814, and one works currently but may be the incorrect fix (#2458).

class Enumerator::Yielder
    def yield(*args)
      @proc.call(*args)
    end
end

module Enumerable
  def first
    val = nil
    catch(:foo) do
      each do |x|
        val = x
        throw :foo
      end
    end
    val
  end
end

p Enumerator.new {|y| y.yield([1])}.to_a
p Enumerator.new {|y| y << [1]}.to_a
p Enumerator.new {|y| y.yield([1])}.map {|e| e}.to_a
p Enumerator.new {|y| y.yield([1])}.lazy.map {|e| e}.to_a
p Enumerator.new {|y| y.yield [1]}.first
$ jruby blah.rb
[[1]]
[[1]]
[[1]]
[[1]]
[1]
@headius headius added this to the JRuby 9.1.4.0 milestone Aug 24, 2016
@enebo enebo removed this from the JRuby 9.1.4.0 milestone Sep 1, 2016
@enebo enebo added this to the JRuby 9.1.5.0 milestone Sep 1, 2016
@enebo enebo added this to the JRuby 9.1.5.0 milestone Sep 1, 2016
@enebo enebo removed this from the JRuby 9.1.4.0 milestone Sep 1, 2016
@enebo enebo removed this from the JRuby 9.1.5.0 milestone Sep 7, 2016
@enebo enebo added this to the JRuby 9.1.6.0 milestone Sep 7, 2016
@enebo enebo added this to the JRuby 9.1.6.0 milestone Sep 7, 2016
@enebo enebo removed this from the JRuby 9.1.5.0 milestone Sep 7, 2016
@headius headius added this to the JRuby 9.2.0.0 milestone Nov 8, 2016
@headius headius removed this from the JRuby 9.1.6.0 milestone Nov 8, 2016
@headius headius mentioned this issue Mar 27, 2018
15 tasks
@enebo enebo removed this from the JRuby 9.2.0.0 milestone May 24, 2018
@enebo enebo added this to the JRuby 9.2.1.0 milestone May 24, 2018
@headius headius removed this from the JRuby 9.2.1.0 milestone Oct 26, 2018
@headius headius added this to the JRuby 9.2.2.0 milestone Oct 26, 2018
@enebo enebo removed this from the JRuby 9.2.2.0 milestone Nov 7, 2018
@enebo enebo added this to the JRuby 9.2.3.0 milestone Nov 7, 2018
@enebo enebo removed this from the JRuby 9.2.3.0 milestone Nov 8, 2018
@enebo enebo added this to the JRuby 9.2.4.0 milestone Nov 8, 2018
@glebm
Copy link
Contributor

@glebm glebm commented Nov 12, 2018

I think one of these Enumerable issues prevents sassc and sassc-rails from working on JRuby (wrong number of arguments (1 for 3)), while the Ruby version of Sass is deprecated and EOL next March.

Loading

@enebo enebo removed this from the JRuby 9.2.4.0 milestone Nov 13, 2018
@enebo enebo added this to the JRuby 9.2.5.0 milestone Nov 13, 2018
@headius
Copy link
Member Author

@headius headius commented Nov 20, 2018

Well, I'm thrilled to see that the native replacement for sass is going to be FFI around libsass! We should prioritize getting this fixed in 9.3 or a 9.2 update by early next year.

Loading

@headius
Copy link
Member Author

@headius headius commented Nov 20, 2018

@glebm Can you give us a reproduction of that error?

Loading

@headius
Copy link
Member Author

@headius headius commented Nov 20, 2018

@glebm Oh I just noticed sass/sassc-rails#92 👍

Loading

@enebo enebo removed this from the JRuby 9.2.5.0 milestone Dec 6, 2018
@enebo enebo added this to the JRuby 9.2.6.0 milestone Dec 6, 2018
@enebo enebo removed this from the JRuby 9.2.6.0 milestone Dec 19, 2018
@enebo enebo added this to the JRuby 9.2.7.0 milestone Dec 19, 2018
@enebo enebo removed this from the JRuby 9.2.7.0 milestone Jan 9, 2019
@enebo enebo added this to the JRuby 9.2.8.0 milestone Jan 9, 2019
kares added a commit that referenced this issue Aug 2, 2019
also from comments GH-3814 which are now passing

`Enumerator.new { |y| y.yield([1]) }.lazy.map { |e| e }.to_a`
seems to be left not working as in MRI
@enebo enebo closed this Aug 6, 2019
Adithya-copart pushed a commit to Adithya-copart/jruby that referenced this issue Aug 25, 2019
also from comments jrubyGH-3814 which are now passing

`Enumerator.new { |y| y.yield([1]) }.lazy.map { |e| e }.to_a`
seems to be left not working as in MRI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants