From 005699bf2fb916ab532f360e37d190c1a7602ec7 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 28 Dec 2012 13:49:58 -0600 Subject: fix .service and .get on dependency objects --- lib/Bread/Board.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/Bread/Board.pm') diff --git a/lib/Bread/Board.pm b/lib/Bread/Board.pm index 7221b62..7a56200 100644 --- a/lib/Bread/Board.pm +++ b/lib/Bread/Board.pm @@ -136,13 +136,16 @@ role HasParameters { class Dependency does Traversable { has Str $.service_path; - has Service $.service handles 'get'; + has Service $.service; # XXX is this the best way to do this? # we can't do it at construction time, since $.parent doesn't get set # until the current object is completely constructed - method service { - $!service //= self.fetch($.service_path); + method service handles 'get' { + # PERL6: // is broken on role type objects + #$!service //= self.fetch($.service_path); + $!service = self.fetch($.service_path) + unless $!service.defined; return $!service; } -- cgit v1.2.3-54-g00ecf