This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: wildcards in parameterized types?


On 10/06/2011 04:32 PM, Jamison Hope wrote:
On Oct 6, 2011, at 2:59 PM, Per Bothner wrote:

I think that's only part of it. The first thing IMO to "fix"
is the type of com.example.SomeClass, so that it is (in Kawa syntax)
java.lang.Class[com.example.SomeClass] so the type matches the
type of the Java expression com.example.SomeClass.class.

Presumably the ParameterizedType instance would be coerced to the
correct type when passed to a function expecting a Class instance.

Careful. I think you're mixing reflective levels here,


The expression java.lang.Object evaluates to a *value* which
the same as the Java expression java.lang.Object.class
(or Class.forName("java.lang.Object")).  This will not change.
What should is the *compile-time type* of the expression.
I.e. when given the QuoteExp that represents java.lang.Object,
what will getType() return?  Will it return a ClassType
as today (Specifically Type.javalangClassType) or will it
return a ParameterizedType instance? The latter seems correct,
but does not change the runtime value or how it is coerced.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]