ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:69516] [Ruby trunk - Bug #11246] [Open] refine block doesn't respect "lexical" refinement information
       [not found] <redmine.issue-11246.20150610162412@ruby-lang.org>
@ 2015-06-10 16:24 ` ko1
  2015-06-10 16:25 ` [ruby-core:69517] [Ruby trunk - Bug #11246] " ko1
  2015-06-24  6:02 ` [ruby-core:69723] [Ruby trunk - Bug #11246] [Rejected] " shugo
  2 siblings, 0 replies; 3+ messages in thread
From: ko1 @ 2015-06-10 16:24 UTC (permalink / raw)
  To: ruby-core

Issue #11246 has been reported by Koichi Sasada.

----------------------------------------
Bug #11246: refine block doesn't respect "lexical" refinement information
https://bugs.ruby-lang.org/issues/11246

* Author: Koichi Sasada
* Status: Open
* Priority: Normal
* Assignee: Shugo Maeda
* ruby -v: ruby 2.3dev
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
The following program making two refinements refine class C.

```ruby
class C
  def foo
    p C
  end
end

module R1
  refine C do
    def foo
      p R1
      super
    end
  end
end

using R1 # 1

module R2
  using R1 # 2

  refine C do
    # using R1 # 3

    def bar
      C.new.foo
    end
  end
end

using R2

C.new.bar
```

Without `using R1 # 3`, `C#foo` was called in `R2::C#bar`.

By `using R21 #1` and `#2`, we declared that this lexical scope should use R1. However, it seems that this declaration is ignored.

Is it an intentional behavior?




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

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

* [ruby-core:69517] [Ruby trunk - Bug #11246] refine block doesn't respect "lexical" refinement information
       [not found] <redmine.issue-11246.20150610162412@ruby-lang.org>
  2015-06-10 16:24 ` [ruby-core:69516] [Ruby trunk - Bug #11246] [Open] refine block doesn't respect "lexical" refinement information ko1
@ 2015-06-10 16:25 ` ko1
  2015-06-24  6:02 ` [ruby-core:69723] [Ruby trunk - Bug #11246] [Rejected] " shugo
  2 siblings, 0 replies; 3+ messages in thread
From: ko1 @ 2015-06-10 16:25 UTC (permalink / raw)
  To: ruby-core

Issue #11246 has been updated by Koichi Sasada.

Description updated

----------------------------------------
Bug #11246: refine block doesn't respect "lexical" refinement information
https://bugs.ruby-lang.org/issues/11246#change-52823

* Author: Koichi Sasada
* Status: Open
* Priority: Normal
* Assignee: Shugo Maeda
* ruby -v: ruby 2.3dev
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
The following program making two refinements refine class C.

```ruby
class C
  def foo
    p C
  end
end

module R1
  refine C do
    def foo
      p R1
      super
    end
  end
end

using R1 # 1

module R2
  using R1 # 2

  refine C do
    # using R1 # 3

    def bar
      C.new.foo
    end
  end
end

using R2

C.new.bar
```

Without `using R1 # 3`, `C#foo` was called in `R2::C#bar`.

By `using R1 #1` and `#2`, we declared that this lexical scope should use R1. However, it seems that this declaration is ignored.

Is it an intentional behavior?




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

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

* [ruby-core:69723] [Ruby trunk - Bug #11246] [Rejected] refine block doesn't respect "lexical" refinement information
       [not found] <redmine.issue-11246.20150610162412@ruby-lang.org>
  2015-06-10 16:24 ` [ruby-core:69516] [Ruby trunk - Bug #11246] [Open] refine block doesn't respect "lexical" refinement information ko1
  2015-06-10 16:25 ` [ruby-core:69517] [Ruby trunk - Bug #11246] " ko1
@ 2015-06-24  6:02 ` shugo
  2 siblings, 0 replies; 3+ messages in thread
From: shugo @ 2015-06-24  6:02 UTC (permalink / raw)
  To: ruby-core

Issue #11246 has been updated by Shugo Maeda.

Status changed from Open to Rejected

Koichi Sasada wrote:
> The following program making two refinements refine class C.
> 
> ```ruby
> class C
>   def foo
>     p C
>   end
> end
> 
> module R1
>   refine C do
>     def foo
>       p R1
>       super
>     end
>   end
> end
> 
> using R1 # 1
> 
> module R2
>   using R1 # 2
> 
>   refine C do
>     # using R1 # 3
> 
>     def bar
>       C.new.foo
>     end
>   end
> end
> 
> using R2
> 
> C.new.bar
> ```
> 
> Without `using R1 # 3`, `C#foo` was called in `R2::C#bar`.
> 
> By `using R1 #1` and `#2`, we declared that this lexical scope should use R1. However, it seems that this declaration is ignored.
> 
> Is it an intentional behavior?

It's intentional.

In refine blocks of a module X, all refinements defined in X are activated, and other refinements previously activated are deactivated.


----------------------------------------
Bug #11246: refine block doesn't respect "lexical" refinement information
https://bugs.ruby-lang.org/issues/11246#change-53102

* Author: Koichi Sasada
* Status: Rejected
* Priority: Normal
* Assignee: Shugo Maeda
* ruby -v: ruby 2.3dev
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
The following program making two refinements refine class C.

```ruby
class C
  def foo
    p C
  end
end

module R1
  refine C do
    def foo
      p R1
      super
    end
  end
end

using R1 # 1

module R2
  using R1 # 2

  refine C do
    # using R1 # 3

    def bar
      C.new.foo
    end
  end
end

using R2

C.new.bar
```

Without `using R1 # 3`, `C#foo` was called in `R2::C#bar`.

By `using R1 #1` and `#2`, we declared that this lexical scope should use R1. However, it seems that this declaration is ignored.

Is it an intentional behavior?




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

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

end of thread, other threads:[~2015-06-24  5:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-11246.20150610162412@ruby-lang.org>
2015-06-10 16:24 ` [ruby-core:69516] [Ruby trunk - Bug #11246] [Open] refine block doesn't respect "lexical" refinement information ko1
2015-06-10 16:25 ` [ruby-core:69517] [Ruby trunk - Bug #11246] " ko1
2015-06-24  6:02 ` [ruby-core:69723] [Ruby trunk - Bug #11246] [Rejected] " shugo

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).