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

Import of overlapping export groups #3191

Closed
p6rt opened this issue Jul 22, 2013 · 7 comments
Closed

Import of overlapping export groups #3191

p6rt opened this issue Jul 22, 2013 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jul 22, 2013

Migrated from rt.perl.org#118965 (status was 'resolved')

Searchable as RT118965$

@p6rt
Copy link
Author

p6rt commented Jul 22, 2013

From @dwarring

Rakudo is trying to import a symbol multiple times, and failing, when it
belongs to overlapping groups.

Consider 'center' in the following class definition​:

  use v6;

  class Alignment {

constant left is export(​:horizontal) = 0.0;
constant right is export(​:horizontal) = 1.0;

constant bottom is export(​:vertical) = 0.0;
constant top is export(​:vertical) = 1.0;

constant center is export(​:horizontal, :vertical) = 0.5;
  }

% perl6 -v
This is perl6 version 2013.07-12-ga1e237b built on parrot 5.5.0 revision
RELEASE_5_5_0
% perl6 -e'use Alignment :horizontal'
% perl6 -e'use Alignment :horizontal, :vertical'
===SORRY!===
Cannot import symbol center from Alignment, because it already exists in
this lexical scope
at -e​:1
------> use Alignment :horizontal, :vertical⏏<EOL>
  expecting any of​:
  pair value
  postfix

@p6rt
Copy link
Author

p6rt commented Jul 23, 2013

From @dwarring

Same without tabs, sorry​:

  use v6;

  class Alignment {

  constant left is export(​:horizontal) = 0.0;
  constant right is export(​:horizontal) = 1.0;

  constant bottom is export(​:vertical) = 0.0;
  constant top is export(​:vertical) = 1.0;

  constant center is export(​:horizontal, :vertical) = 0.5;
  }

@p6rt
Copy link
Author

p6rt commented Jul 24, 2013

From @dwarring

Another failing example​:

  use v6;

  class Test {
  sub foo is export(​:foo) {42};
  sub bar is export(​:bar) {0x42};
  sub baz is export(​:foo, :bar) {0o42};
  }

  % perl6 -e 'use Test :foo, :bar'
  ===SORRY!===
  Cannot import symbol &baz from Test, because it already exists in this
lexical scope
  ...

On Mon, Jul 22, 2013 at 3​:40 PM, perl6 via RT
<perl6-bugs-followup@​perl.org>wrote​:

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding​:
"[BUG] Import of overlapping export groups",
a summary of which appears below.

There is no need to reply to this message right now. Your ticket has been
assigned an ID of [perl #​118965].

Please include the string​:

     \[perl #&#8203;118965\]

in the subject line of all future correspondence about this issue. To do
so,
you may reply to this message.

                    Thank you,
                    perl6\-bugs\-followup@&#8203;perl\.org

-------------------------------------------------------------------------
Rakudo is trying to import a symbol multiple times, and failing, when it
belongs to overlapping groups.

Consider 'center' in the following class definition​:

use v6;

class Alignment \{

constant left is export(​:horizontal) = 0.0;
constant right is export(​:horizontal) = 1.0;

constant bottom is export(​:vertical) = 0.0;
constant top is export(​:vertical) = 1.0;

constant center is export(​:horizontal, :vertical) = 0.5;
}

% perl6 -v
This is perl6 version 2013.07-12-ga1e237b built on parrot 5.5.0 revision
RELEASE_5_5_0
% perl6 -e'use Alignment :horizontal'
% perl6 -e'use Alignment :horizontal, :vertical'
===SORRY!===
Cannot import symbol center from Alignment, because it already exists in
this lexical scope
at -e​:1
------> use Alignment :horizontal, :vertical⏏<EOL>
expecting any of​:
pair value
postfix

@p6rt
Copy link
Author

p6rt commented Jul 27, 2013

From @moritz

Fixed with this commit​:

commit 1f1076a2facc612b67af7adfe6def5e41c8a94c0
Author​: Moritz Lenz <moritz@​faui2k3.org>
Date​: Sat Jul 27 07​:23​:17 2013 +0200

  Do not complain when exporting exactly the same symbol twice
 
  fixes RT #​118965

src/Perl6/World.nqp | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

@p6rt
Copy link
Author

p6rt commented Jul 27, 2013

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 27, 2013

From @moritz

Tested in S11-modules/import.t

@p6rt
Copy link
Author

p6rt commented Jul 27, 2013

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jul 27, 2013
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant