diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java index b8628fbc7c0..4513595264f 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java @@ -2475,9 +2475,13 @@ If finally block is present, its last expression is the value of try expression. return hasTypeInfoForInstanceOf(type.getArguments().get(0).getType()); } - for(TypeParameterDescriptor proj : classDescriptor.getTypeConstructor().getParameters()) { - if(proj.isReified()) { - return true; + for (int i = 0; i < type.getArguments().size(); i++) { + TypeParameterDescriptor typeParameterDescriptor = classDescriptor.getTypeConstructor().getParameters().get(i); + if(typeParameterDescriptor.isReified()) { + TypeProjection typeProjection = type.getArguments().get(i); + if( !typeProjection.getType().equals(typeParameterDescriptor.getUpperBoundsAsType())) { + return true; + } } } diff --git a/examples/src/benchmarks/FList.kt b/examples/src/benchmarks/FList.kt index 5d806215920..17179b006bb 100644 --- a/examples/src/benchmarks/FList.kt +++ b/examples/src/benchmarks/FList.kt @@ -30,7 +30,7 @@ class StandardFList (override val head: T, override val tail: FList) : FLi fun FList.plus2(element: T): FList = when(this) { - is EmptyFList => OneElementFList(element) + is EmptyFList<*> => OneElementFList(element) else => StandardFList(element, this) } @@ -67,4 +67,4 @@ fun main(args: Array) { System.out?.println(System.currentTimeMillis() - start2) System.out?.println() } -} \ No newline at end of file +} diff --git a/stdlib/src/jet/typeinfo/TypeInfo.java b/stdlib/src/jet/typeinfo/TypeInfo.java index fbba351bcbd..dfdda4e367e 100644 --- a/stdlib/src/jet/typeinfo/TypeInfo.java +++ b/stdlib/src/jet/typeinfo/TypeInfo.java @@ -376,7 +376,7 @@ public abstract class TypeInfo implements JetObject { return false; } if (superType.projections == null || superType.projections.length != projections.length) { - throw new IllegalArgumentException("inconsistent type infos for the same class"); + throw new IllegalArgumentException("inconsistent type info for the same class"); } for (int i = 0; i < projections.length; i++) { // TODO handle variance here @@ -451,18 +451,18 @@ public abstract class TypeInfo implements JetObject { if(klass == null) return null; - lock.readLock().lock(); +// lock.readLock().lock(); Signature sig = map.get(klass); - lock.readLock().unlock(); +// lock.readLock().unlock(); if (sig == null) { - lock.writeLock().lock(); +// lock.writeLock().lock(); sig = map.get(klass); if (sig == null) { sig = internalParse(klass); } - lock.writeLock().unlock(); +// lock.writeLock().unlock(); } return sig; }