ok, so if I have an `interface FooExtension { Prop...
# community-support
c
ok, so if I have an
interface FooExtension { Property<String> getBar() }
and I need to add a default, if I call
getBar().convention("baz")
before its set then I'll just get
"baz"
even if I later call
bar.set("other")
because apparently it's more eager than I'd think... because I'm not calling
get()
until after the `set`s have been called. Is there some other way to do this such that convention is really set in the
FooExtension
? honestly not certain that'd work either, it sounded good but now it doesn't sound like it would. If this were really a lazy stream it wouldn't insert the default until I called get.
t
set should be replacing the convention. if it doesn't i've written a lot of stuff with bad assumptions being made
1
c
that's what I thought too..
but that's not what my test tells me
t
i'd say make sure your set call is getting hit before something reads. make sure nothing is calling get before some afterEvaluate etc
convention/set via a provider rather than raw value so you can log or something?
c
hmm... maybe it's not the convention, or maybe it is,
zip
as it passes through says the uri should be right
as I'm evaluating the lambda that would be called
but when I get it back it's like those values weren't set
wait... maybe it's zip that doesn't work like I'd think...
or maybe it's uri
hrmm..
oh, it must be uri that doesn't work how I think it does, lovely
I don't always write tests, but when I don't things don't actually work
v
Actually, in which order you call
convention
and
set
is irrelevant. If
set
is never called, or the last call of it was with
null
as argument, then the
convention
is returned on
get
, otherwise the set value.
c
yeah, it was a different stupid
👌 1