Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
Issue #6797: Add *Array.with constructor to fake arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
tombentley committed Dec 7, 2016
1 parent 90fa72f commit 276299a
Show file tree
Hide file tree
Showing 10 changed files with 221 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
//
//Only the value type static methods are really invoked.
@Ceylon(major = 8)
@Class
@Class(constructors=true)
@ValueType
@Generated(value="ant")
public final class BooleanArray implements ReifiedType {
Expand Down Expand Up @@ -108,6 +108,27 @@ public BooleanArray(
public static BooleanArray instance(boolean[] value){
throw Util.makeJavaArrayWrapperException();
}

@Ignore
public final static with_ with_ = null;

@Ignore
@com.redhat.ceylon.compiler.java.metadata.ConstructorName("with")
public static final class with_ {
private with_() {}
};

@ceylon.language.SharedAnnotation$annotation$
@com.redhat.ceylon.compiler.java.metadata.Name("with")
public BooleanArray(
@Ignore
with_ $name$,
@com.redhat.ceylon.common.NonNull
@Name("elements")
@TypeInfo("{ceylon.language::Boolean*}")
final Iterable<? extends ceylon.language.Boolean, ? extends java.lang.Object> elements$param$) {
throw Util.makeJavaArrayWrapperException();
}

/**
* Get the element with the given {@code index}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
//
//Only the value type static methods are really invoked.
@Ceylon(major = 8)
@Class
@Class(constructors=true)
@ValueType
@Generated(value="ant")
public final class ByteArray implements ReifiedType {
Expand Down Expand Up @@ -108,6 +108,27 @@ public ByteArray(
public static ByteArray instance(byte[] value){
throw Util.makeJavaArrayWrapperException();
}

@Ignore
public final static with_ with_ = null;

@Ignore
@com.redhat.ceylon.compiler.java.metadata.ConstructorName("with")
public static final class with_ {
private with_() {}
};

@ceylon.language.SharedAnnotation$annotation$
@com.redhat.ceylon.compiler.java.metadata.Name("with")
public ByteArray(
@Ignore
with_ $name$,
@com.redhat.ceylon.common.NonNull
@Name("elements")
@TypeInfo("{ceylon.language::Byte*}")
final Iterable<? extends ceylon.language.Byte, ? extends java.lang.Object> elements$param$) {
throw Util.makeJavaArrayWrapperException();
}

/**
* Get the element with the given {@code index}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
//
//Only the value type static methods are really invoked.
@Ceylon(major = 8)
@Class
@Class(constructors=true)
@ValueType
@Generated(value="ant")
public final class CharArray implements ReifiedType {
Expand Down Expand Up @@ -108,6 +108,27 @@ public CharArray(
public static CharArray instance(char[] value){
throw Util.makeJavaArrayWrapperException();
}

@Ignore
public final static with_ with_ = null;

@Ignore
@com.redhat.ceylon.compiler.java.metadata.ConstructorName("with")
public static final class with_ {
private with_() {}
};

@ceylon.language.SharedAnnotation$annotation$
@com.redhat.ceylon.compiler.java.metadata.Name("with")
public CharArray(
@Ignore
with_ $name$,
@com.redhat.ceylon.common.NonNull
@Name("elements")
@TypeInfo("{ceylon.language::Character*}")
final Iterable<? extends ceylon.language.Character, ? extends java.lang.Object> elements$param$) {
throw Util.makeJavaArrayWrapperException();
}

/**
* Get the element with the given {@code index}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
//
//Only the value type static methods are really invoked.
@Ceylon(major = 8)
@Class
@Class(constructors=true)
@ValueType
@Generated(value="ant")
public final class DoubleArray implements ReifiedType {
Expand Down Expand Up @@ -108,6 +108,27 @@ public DoubleArray(
public static DoubleArray instance(double[] value){
throw Util.makeJavaArrayWrapperException();
}

@Ignore
public final static with_ with_ = null;

@Ignore
@com.redhat.ceylon.compiler.java.metadata.ConstructorName("with")
public static final class with_ {
private with_() {}
};

@ceylon.language.SharedAnnotation$annotation$
@com.redhat.ceylon.compiler.java.metadata.Name("with")
public DoubleArray(
@Ignore
with_ $name$,
@com.redhat.ceylon.common.NonNull
@Name("elements")
@TypeInfo("{ceylon.language::Float*}")
final Iterable<? extends ceylon.language.Float, ? extends java.lang.Object> elements$param$) {
throw Util.makeJavaArrayWrapperException();
}

/**
* Get the element with the given {@code index}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
//
//Only the value type static methods are really invoked.
@Ceylon(major = 8)
@Class
@Class(constructors=true)
@ValueType
@Generated(value="ant")
public final class FloatArray implements ReifiedType {
Expand Down Expand Up @@ -108,6 +108,27 @@ public FloatArray(
public static FloatArray instance(float[] value){
throw Util.makeJavaArrayWrapperException();
}

@Ignore
public final static with_ with_ = null;

@Ignore
@com.redhat.ceylon.compiler.java.metadata.ConstructorName("with")
public static final class with_ {
private with_() {}
};

@ceylon.language.SharedAnnotation$annotation$
@com.redhat.ceylon.compiler.java.metadata.Name("with")
public FloatArray(
@Ignore
with_ $name$,
@com.redhat.ceylon.common.NonNull
@Name("elements")
@TypeInfo("{ceylon.language::Float*}")
final Iterable<? extends ceylon.language.Float, ? extends java.lang.Object> elements$param$) {
throw Util.makeJavaArrayWrapperException();
}

/**
* Get the element with the given {@code index}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
//
//Only the value type static methods are really invoked.
@Ceylon(major = 8)
@Class
@Class(constructors=true)
@ValueType
@Generated(value="ant")
public final class IntArray implements ReifiedType {
Expand Down Expand Up @@ -108,6 +108,27 @@ public IntArray(
public static IntArray instance(int[] value){
throw Util.makeJavaArrayWrapperException();
}

@Ignore
public final static with_ with_ = null;

@Ignore
@com.redhat.ceylon.compiler.java.metadata.ConstructorName("with")
public static final class with_ {
private with_() {}
};

@ceylon.language.SharedAnnotation$annotation$
@com.redhat.ceylon.compiler.java.metadata.Name("with")
public IntArray(
@Ignore
with_ $name$,
@com.redhat.ceylon.common.NonNull
@Name("elements")
@TypeInfo("{ceylon.language::Integer*}")
final Iterable<? extends ceylon.language.Integer, ? extends java.lang.Object> elements$param$) {
throw Util.makeJavaArrayWrapperException();
}

/**
* Get the element with the given {@code index}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
//
//Only the value type static methods are really invoked.
@Ceylon(major = 8)
@Class
@Class(constructors=true)
@ValueType
@Generated(value="ant")
public final class LongArray implements ReifiedType {
Expand Down Expand Up @@ -108,6 +108,27 @@ public LongArray(
public static LongArray instance(long[] value){
throw Util.makeJavaArrayWrapperException();
}

@Ignore
public final static with_ with_ = null;

@Ignore
@com.redhat.ceylon.compiler.java.metadata.ConstructorName("with")
public static final class with_ {
private with_() {}
};

@ceylon.language.SharedAnnotation$annotation$
@com.redhat.ceylon.compiler.java.metadata.Name("with")
public LongArray(
@Ignore
with_ $name$,
@com.redhat.ceylon.common.NonNull
@Name("elements")
@TypeInfo("{ceylon.language::Integer*}")
final Iterable<? extends ceylon.language.Integer, ? extends java.lang.Object> elements$param$) {
throw Util.makeJavaArrayWrapperException();
}

/**
* Get the element with the given {@code index}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ceylon.language.Array;
import ceylon.language.AssertionError;
import ceylon.language.Iterable;

import com.redhat.ceylon.compiler.java.Util;
import com.redhat.ceylon.compiler.java.metadata.Ceylon;
Expand Down Expand Up @@ -85,7 +86,28 @@ public ObjectArray(
@Name("size") int size){
throw Util.makeJavaArrayWrapperException();
}


@Ignore
public final static with_ with_ = null;

@Ignore
@com.redhat.ceylon.compiler.java.metadata.ConstructorName("with")
public static final class with_ {
private with_() {}
};

@ceylon.language.SharedAnnotation$annotation$
@com.redhat.ceylon.compiler.java.metadata.Name("with")
public ObjectArray(
@Ignore
with_ $name$,
@com.redhat.ceylon.common.NonNull
@Name("elements")
@TypeInfo("{T*}")
final Iterable<? extends T, ? extends java.lang.Object> elements$param$) {
throw Util.makeJavaArrayWrapperException();
}

@Ignore
// For consistency with the rules for ValueTypes
public static <T> ObjectArray<T> instance(T[] value){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
//
//Only the value type static methods are really invoked.
@Ceylon(major = 8)
@Class
@Class(constructors=true)
@ValueType
@Generated(value="ant")
public final class ShortArray implements ReifiedType {
Expand Down Expand Up @@ -108,6 +108,27 @@ public ShortArray(
public static ShortArray instance(short[] value){
throw Util.makeJavaArrayWrapperException();
}

@Ignore
public final static with_ with_ = null;

@Ignore
@com.redhat.ceylon.compiler.java.metadata.ConstructorName("with")
public static final class with_ {
private with_() {}
};

@ceylon.language.SharedAnnotation$annotation$
@com.redhat.ceylon.compiler.java.metadata.Name("with")
public ShortArray(
@Ignore
with_ $name$,
@com.redhat.ceylon.common.NonNull
@Name("elements")
@TypeInfo("{ceylon.language::Integer*}")
final Iterable<? extends ceylon.language.Integer, ? extends java.lang.Object> elements$param$) {
throw Util.makeJavaArrayWrapperException();
}

/**
* Get the element with the given {@code index}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
//
//Only the value type static methods are really invoked.
@Ceylon(major = 8)
@Class
@Class(constructors=true)
@ValueType
@Generated(value="ant")
public final class @Classname@ implements ReifiedType {
Expand Down Expand Up @@ -108,6 +108,27 @@ public final class @Classname@ implements ReifiedType {
public static @Classname@ instance(@PrimitiveType@[] value){
throw Util.makeJavaArrayWrapperException();
}

@Ignore
public final static with_ with_ = null;

@Ignore
@com.redhat.ceylon.compiler.java.metadata.ConstructorName("with")
public static final class with_ {
private with_() {}
};

@ceylon.language.SharedAnnotation$annotation$
@com.redhat.ceylon.compiler.java.metadata.Name("with")
public @Classname@(
@Ignore
with_ $name$,
@com.redhat.ceylon.common.NonNull
@Name("elements")
@TypeInfo("{@BoxedTypeName@*}")
final Iterable<? extends @BoxedType@, ? extends java.lang.Object> elements$param$) {
throw Util.makeJavaArrayWrapperException();
}

/**
* Get the element with the given {@code index}.
Expand Down

0 comments on commit 276299a

Please sign in to comment.