def args in constructors

This commit is contained in:
Alex Tkachman
2012-02-09 20:36:09 +02:00
parent 5c8fb3febf
commit 8e6e8e938c
3 changed files with 20 additions and 2 deletions
@@ -486,6 +486,8 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
AnnotationVisitor jetValueParameterAnnotation =
mv.visitParameterAnnotation(i++, JvmStdlibNames.JET_VALUE_PARAMETER.getDescriptor(), true);
jetValueParameterAnnotation.visit(JvmStdlibNames.JET_VALUE_PARAMETER_NAME_FIELD, valueParameter.getName());
if(valueParameter.hasDefaultValue())
jetValueParameterAnnotation.visit(JvmStdlibNames.JET_VALUE_PARAMETER_HAS_DEFAULT_VALUE_FIELD, Boolean.TRUE);
jetValueParameterAnnotation.visitEnd();
}
}
@@ -574,7 +576,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
}
final ClassDescriptor outerDescriptor = getOuterClassDescriptor();
if (outerDescriptor != null && outerDescriptor.getKind() != ClassKind.OBJECT) {
if (outerDescriptor != null && !CodegenUtil.isClassObject(outerDescriptor)) {
final Type type = typeMapper.mapType(outerDescriptor.getDefaultType(), OwnerKind.IMPLEMENTATION);
String interfaceDesc = type.getDescriptor();
final String fieldName = "this$0";
+1 -1
View File
@@ -3,7 +3,7 @@ package std.concurrent
import java.util.concurrent.Executor
import jet.Iterator
class FunctionalQueue<T>(
class FunctionalQueue<T> (
val input: FunctionalList<T> = FunctionalList.emptyList<T>(),
val output: FunctionalList<T> = FunctionalList.emptyList<T>()) {
+16
View File
@@ -0,0 +1,16 @@
package test.concurrent
import std.concurrent.*
import junit.framework.*
class FListTest() : TestCase() {
fun testEmpty() {
val empty = FunctionalQueue<Int> ()
Assert.assertTrue(empty.empty)
}
fun testNonEmpty() {
// val empty = FunctionalList.emptyList<Int> ()
// assertTrue(!(empty + 10).empty)
}
}