Merge remote branch 'origin/master'

This commit is contained in:
Andrey Breslav
2011-05-13 15:33:55 +04:00
3 changed files with 9 additions and 6 deletions
+6 -3
View File
@@ -1,10 +1,13 @@
namespace jet namespace jet
class TypeInfo<T> { namespace typeinfo {
fun isSubtypeOf(other : TypeInfo<*>) : Boolean class TypeInfo<T> {
fun isInstance(obj : Any?) : Boolean fun isSubtypeOf(other : TypeInfo<*>) : Boolean
fun isInstance(obj : Any?) : Boolean
}
} }
class Iterator<out T> { class Iterator<out T> {
fun next() : T fun next() : T
abstract val hasNext : Boolean abstract val hasNext : Boolean
@@ -90,7 +90,7 @@ public class JetStandardLibrary {
this.stringClass = (ClassDescriptor) libraryScope.getClassifier("String"); this.stringClass = (ClassDescriptor) libraryScope.getClassifier("String");
this.arrayClass = (ClassDescriptor) libraryScope.getClassifier("Array"); this.arrayClass = (ClassDescriptor) libraryScope.getClassifier("Array");
this.iterableClass = (ClassDescriptor) libraryScope.getClassifier("Iterable"); this.iterableClass = (ClassDescriptor) libraryScope.getClassifier("Iterable");
this.typeInfoClass = (ClassDescriptor) libraryScope.getClassifier("TypeInfo"); this.typeInfoClass = (ClassDescriptor) libraryScope.getNamespace("typeinfo").getMemberScope().getClassifier("TypeInfo");
this.byteType = new JetTypeImpl(getByte()); this.byteType = new JetTypeImpl(getByte());
this.charType = new JetTypeImpl(getChar()); this.charType = new JetTypeImpl(getChar());
@@ -82,8 +82,8 @@ public class JetTypeCheckerTest extends LightDaemonAnalyzerTestCase {
} }
public void testTypeInfo() throws Exception { public void testTypeInfo() throws Exception {
assertType("typeof(1)", "TypeInfo<Int>"); assertType("typeof(1)", "typeinfo.TypeInfo<Int>");
assertType("typeof(typeof(1))", "TypeInfo<TypeInfo<Int>>"); assertType("typeof(typeof(1))", "typeinfo.TypeInfo<typeinfo.TypeInfo<Int>>");
} }
public void testJumps() throws Exception { public void testJumps() throws Exception {