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

Test autovivification of attributes when using methods that should be read only #153

Closed
wants to merge 1 commit into from

Conversation

@pplu
Copy link

commented Oct 26, 2017

Test case for https://rt.cpan.org/Public/Bug/Display.html?id=123385

  • undefined Hash attributes autovivify when called with delegated methods
  • undefined Bools don't autovivify
  • undefined Arrays don't work with delegated methods.

I think that delegated methods should work on undefined array attributes, returning undef, or 0 for count (just like Hash)

@karenetheridge

This comment has been minimized.

Copy link
Member

commented Nov 21, 2017

Looks like t/native_traits/traits_dont_vivify.t is failing in travis.

@autarch

This comment has been minimized.

Copy link
Member

commented Nov 21, 2017

We'd expect it to fail. It's testing that Moose doesn't do something that it currently does.

That said, I think there was agreement that the right fix is to have Moose throw an exception when an attr w/ native traits is not yet populated when the delegation is called. That matches the behavior of other delegations.

@autarch autarch closed this Nov 21, 2017

@autarch

This comment has been minimized.

Copy link
Member

commented Nov 21, 2017

I closed this since we'll need a different test for the change to make Moose throw exceptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.