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
Exported subs from imported modules affect imported modules downstream in Rakudo #1000
Comments
From @masak<masak> I've asked this before, but gotten contradictory answers: if $ cat A.pm Finally, getting some support from S11: "It must be possible for any |
From @jnthnOn Sun May 17 11:57:26 2009, masak wrote:
This is probably fixed since we implemented lexical import. On latest C:\Consulting\rakudo>type A.pm C:\Consulting\rakudo>type B.pm C:\Consulting\rakudo>perl6 -e "use A; use B;" So, seems fine now. :-) Given to moritz++ for spectests. Thanks, Jonathan |
The RT System itself - Status changed from 'new' to 'open' |
@moritz - Status changed from 'open' to 'resolved' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in at least one of these files: t/spec/S10-packages/basic.t, t/spec/packages/Foo.pm, t/spec/packages/OverrideTest.pm commit 7c110845fe4de348e248528161243bf60e99bfeb [t/spec] test for RT #65738, overriding exports do not affect modules loaded later on Inline Patchdiff --git a/t/spec/S10-packages/basic.t b/t/spec/S10-packages/basic.t
index f1dfacf..1e1a88c 100644
--- a/t/spec/S10-packages/basic.t
+++ b/t/spec/S10-packages/basic.t
@@ -4,7 +4,7 @@ use v6;
use Test;
-plan 51;
+plan 52;
regex fairly_conclusive_platform_error {:i ^\N*<<Null?>>}
@@ -206,6 +206,11 @@ eval_lives_ok q' module MapTester { (1, 2, 3).map: { $_ } } ',
eval_lives_ok 'use LoadFromInsideAClass',
'can "use" a class inside a class';
+ # RT #65738
+ use Foo;
+ use OverrideTest;
+ is test_ucfirst('moin'), 'Moin',
+ 'overrides from one module do not affect a module that is loaded later on';
}
{
diff --git a/t/spec/packages/Foo.pm b/t/spec/packages/Foo.pm
index 3a2edc3..85856b5 100644
--- a/t/spec/packages/Foo.pm
+++ b/t/spec/packages/Foo.pm
@@ -4,3 +4,5 @@ use v6;
class Foo;
method foo { "foo" }
+
+sub ucfirst($thing) is export(:DEFAULT) { 'overridden ucfirst' }
diff --git a/t/spec/packages/OverrideTest.pm b/t/spec/packages/OverrideTest.pm
new file mode 100644
index 0000000..fc42130
--- /dev/null
+++ b/t/spec/packages/OverrideTest.pm
@@ -0,0 +1,5 @@
+module OverrideTest {
+ sub test_ucfirst($y) is export(:DEFAULT) {
+ ucfirst($y);
+ }
+} |
Migrated from rt.perl.org#65738 (status was 'resolved')
Searchable as RT65738$
The text was updated successfully, but these errors were encountered: