On Wednesday 28 January 2004 10:55, Leo Sutic wrote:
> > From: Niclas Hedhman [mailto:[EMAIL PROTECTED]
> > A a = sm.<A>lookup ("B");
> >
> > How would the compiler know?
>
> OK, *that* is something that can't be statically checked. The upside is
> that
> we've isolated the *only* part that can't be statically checked, and
> we've isolated it in the container:
A a = sm.<A>lookup ("B");
A a = (A) sm.lookup ("B");
So where is the famous difference. I don't care if I get a ClassCastException
on this line, or the cast in the ServiceManager.
More interestingly though, what about;
A a = sm.<A>lookup();
Can the ServiceManager do the equivalent of
Class c = T.class;
So that Merlin could lookup a proper type without argument in the lookup?
That would be nice! (Although it may be years away before we can do it.)
Niclas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]