Parameterizing on incomplete types
Per Bothner
per@bothner.com
Fri Dec 2 08:56:00 GMT 2011
On 12/01/2011 01:05 AM, Per Bothner wrote:
> The attached patch solved the name-lookup part of the problem.
I checked in the patch.
> I now get:
>
> string>:1:27: type parameter T must extend Object which is incompatible
> with Foo
>
> This is because we haven't set yet Foo's supertypes. Of course this is
> nonsense in the special case of Object. I think we can fix the general
> case by moving the subtype test later, probably to InlineCalls.
> The tricky part is figuring out how to do the subtype test in InlineCalls.
>
> Worst case, we can special-case Object, and change teh general case to
> warnings.
I checked in a patch that effectively special-cases Object.
(Specifically, I added an "optimization" is ClassType#isSubclass.)
So we no longer get that error - now we just have to deal with
<string>:1:1: missing implementation for
java.lang.Comparable.compareTo(T)int
How ambitious are you about getting into Deep Kawa Stuff? :-)
--
--Per Bothner
per@bothner.com http://per.bothner.com/
More information about the Kawa
mailing list