ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:72455] [Ruby trunk - Bug #11867] [Open] overriden constant instance variable mismatch
       [not found] <redmine.issue-11867.20151223193402@ruby-lang.org>
@ 2015-12-23 19:34 ` sephvelut
  2015-12-23 19:35 ` [ruby-core:72456] [Ruby trunk - Bug #11867] " sephvelut
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: sephvelut @ 2015-12-23 19:34 UTC (permalink / raw)
  To: ruby-core

Issue #11867 has been reported by dingo egret.

----------------------------------------
Bug #11867: overriden constant instance variable mismatch
https://bugs.ruby-lang.org/issues/11867

* Author: dingo egret
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
A = Struct.new(:a)

A.new(1)
#<struct A a=1>

class A
def initialize(b)
@b = b
end
end

A.new(1)
#<struct A a=nil>

Is this expected?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:72456] [Ruby trunk - Bug #11867] overriden constant instance variable mismatch
       [not found] <redmine.issue-11867.20151223193402@ruby-lang.org>
  2015-12-23 19:34 ` [ruby-core:72455] [Ruby trunk - Bug #11867] [Open] overriden constant instance variable mismatch sephvelut
@ 2015-12-23 19:35 ` sephvelut
  2015-12-23 19:37 ` [ruby-core:72457] " sephvelut
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: sephvelut @ 2015-12-23 19:35 UTC (permalink / raw)
  To: ruby-core

Issue #11867 has been updated by dingo egret.


A = Struct.new(:a)

A.new(1)
<struct A a=1>

class A
def initialize(b)
@b = b
end
end

A.new(1)
<struct A a=nil>

Is this expected?

----------------------------------------
Bug #11867: overriden constant instance variable mismatch
https://bugs.ruby-lang.org/issues/11867#change-55748

* Author: dingo egret
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
A = Struct.new(:a)

A.new(1)
#<struct A a=1>

class A
def initialize(b)
@b = b
end
end

A.new(1)
#<struct A a=nil>

Is this expected?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:72457] [Ruby trunk - Bug #11867] overriden constant instance variable mismatch
       [not found] <redmine.issue-11867.20151223193402@ruby-lang.org>
  2015-12-23 19:34 ` [ruby-core:72455] [Ruby trunk - Bug #11867] [Open] overriden constant instance variable mismatch sephvelut
  2015-12-23 19:35 ` [ruby-core:72456] [Ruby trunk - Bug #11867] " sephvelut
@ 2015-12-23 19:37 ` sephvelut
  2015-12-24  0:32 ` [ruby-core:72460] [Ruby trunk - Bug #11867] [Feedback] " nobu
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: sephvelut @ 2015-12-23 19:37 UTC (permalink / raw)
  To: ruby-core

Issue #11867 has been updated by dingo egret.


A = Struct.new(:a)

A.new(1)
struct A a=1

class A
def initialize(b)
@b = b
end
end

A.new(1)
struct A a=nil

Is this expected?


----------------------------------------
Bug #11867: overriden constant instance variable mismatch
https://bugs.ruby-lang.org/issues/11867#change-55749

* Author: dingo egret
* Status: Open
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
A = Struct.new(:a)

A.new(1)
#<struct A a=1>

class A
def initialize(b)
@b = b
end
end

A.new(1)
#<struct A a=nil>

Is this expected?



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:72460] [Ruby trunk - Bug #11867] [Feedback] overriden constant instance variable mismatch
       [not found] <redmine.issue-11867.20151223193402@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2015-12-23 19:37 ` [ruby-core:72457] " sephvelut
@ 2015-12-24  0:32 ` nobu
  2015-12-24  2:21 ` [ruby-core:72462] [Ruby trunk - Bug #11867] " shugo
  2015-12-29 19:33 ` [ruby-core:72600] " sephvelut
  5 siblings, 0 replies; 6+ messages in thread
From: nobu @ 2015-12-24  0:32 UTC (permalink / raw)
  To: ruby-core

Issue #11867 has been updated by Nobuyoshi Nakada.

Description updated
Status changed from Open to Feedback

Exactly.

What do you expect instead?


----------------------------------------
Bug #11867: overriden constant instance variable mismatch
https://bugs.ruby-lang.org/issues/11867#change-55751

* Author: dingo egret
* Status: Feedback
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
~~~ruby
A = Struct.new(:a)

A.new(1)
#<struct A a=1>

class A
  def initialize(b)
    @b = b
  end
end

A.new(1)
#<struct A a=nil>
~~~

Is this expected?




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:72462] [Ruby trunk - Bug #11867] overriden constant instance variable mismatch
       [not found] <redmine.issue-11867.20151223193402@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2015-12-24  0:32 ` [ruby-core:72460] [Ruby trunk - Bug #11867] [Feedback] " nobu
@ 2015-12-24  2:21 ` shugo
  2015-12-29 19:33 ` [ruby-core:72600] " sephvelut
  5 siblings, 0 replies; 6+ messages in thread
From: shugo @ 2015-12-24  2:21 UTC (permalink / raw)
  To: ruby-core

Issue #11867 has been updated by Shugo Maeda.


dingo egret wrote:
> ~~~ruby
> class A
>   def initialize(b)
>     @b = b
>   end
> end

You should call super if you want to set the member `a`.

~~~ruby
class A
  def initialize(b)
    super(b)
    @b = b
  end
end
~~~



----------------------------------------
Bug #11867: overriden constant instance variable mismatch
https://bugs.ruby-lang.org/issues/11867#change-55753

* Author: dingo egret
* Status: Feedback
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
~~~ruby
A = Struct.new(:a)

A.new(1)
#<struct A a=1>

class A
  def initialize(b)
    @b = b
  end
end

A.new(1)
#<struct A a=nil>
~~~

Is this expected?




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:72600] [Ruby trunk - Bug #11867] overriden constant instance variable mismatch
       [not found] <redmine.issue-11867.20151223193402@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2015-12-24  2:21 ` [ruby-core:72462] [Ruby trunk - Bug #11867] " shugo
@ 2015-12-29 19:33 ` sephvelut
  5 siblings, 0 replies; 6+ messages in thread
From: sephvelut @ 2015-12-29 19:33 UTC (permalink / raw)
  To: ruby-core

Issue #11867 has been updated by dingo egret.


Nobuyoshi Nakada wrote:
> Exactly.
> 
> What do you expect instead?

I expected the latest constant to set its @b property. If not Class A, at the very least I expected Struct :a to get set. Is this not the intuitive thing to expect? People send arguments based on param ordering in constant definition. This is totally bypassing that expectation.

----------------------------------------
Bug #11867: overriden constant instance variable mismatch
https://bugs.ruby-lang.org/issues/11867#change-55849

* Author: dingo egret
* Status: Feedback
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
~~~ruby
A = Struct.new(:a)

A.new(1)
#<struct A a=1>

class A
  def initialize(b)
    @b = b
  end
end

A.new(1)
#<struct A a=nil>
~~~

Is this expected?




-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-12-29 19:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-11867.20151223193402@ruby-lang.org>
2015-12-23 19:34 ` [ruby-core:72455] [Ruby trunk - Bug #11867] [Open] overriden constant instance variable mismatch sephvelut
2015-12-23 19:35 ` [ruby-core:72456] [Ruby trunk - Bug #11867] " sephvelut
2015-12-23 19:37 ` [ruby-core:72457] " sephvelut
2015-12-24  0:32 ` [ruby-core:72460] [Ruby trunk - Bug #11867] [Feedback] " nobu
2015-12-24  2:21 ` [ruby-core:72462] [Ruby trunk - Bug #11867] " shugo
2015-12-29 19:33 ` [ruby-core:72600] " sephvelut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).