null if not primitive
+ */
+ @Nullable
+ public JetType getPrimitiveArrayJetTypeByPrimitiveJetType(JetType jetType) {
+ return primitiveJetTypeToJetArrayType.get(jetType);
+ }
+
+ @NotNull
+ public ClassDescriptor getPrimitiveArrayClassDescriptor(PrimitiveType primitiveType) {
initStdClasses();
- return charArrayClass;
+ return primitiveTypeToArrayClass.get(primitiveType);
}
- public ClassDescriptor getShortArrayClass() {
+
+ @NotNull
+ public JetType getNullablePrimitiveArrayJetType(PrimitiveType primitiveType) {
initStdClasses();
- return shortArrayClass;
+ return primitiveTypeToNullableArrayJetType.get(primitiveType);
}
- public ClassDescriptor getIntArrayClass() {
- initStdClasses();
- return intArrayClass;
- }
-
- public ClassDescriptor getLongArrayClass() {
- initStdClasses();
- return longArrayClass;
- }
-
- public ClassDescriptor getFloatArrayClass() {
- initStdClasses();
- return floatArrayClass;
- }
-
- public ClassDescriptor getDoubleArrayClass() {
- initStdClasses();
- return doubleArrayClass;
- }
-
- public ClassDescriptor getBooleanArrayClass() {
- initStdClasses();
- return booleanArrayClass;
- }
-
- public JetType getNullableByteArrayType() {
- return nullableByteArrayType;
- }
-
- public JetType getNullableCharArrayType() {
- return nullableCharArrayType;
- }
-
- public JetType getNullableShortArrayType() {
- return nullableShortArrayType;
- }
-
- public JetType getNullableIntArrayType() {
- return nullableIntArrayType;
- }
-
- public JetType getNullableLongArrayType() {
- return nullableLongArrayType;
- }
-
- public JetType getNullableFloatArrayType() {
- return nullableFloatArrayType;
- }
-
- public JetType getNullableDoubleArrayType() {
- return nullableDoubleArrayType;
- }
-
- public JetType getNullableBooleanArrayType() {
- return nullableBooleanArrayType;
- }
}
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/PrimitiveType.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/PrimitiveType.java
new file mode 100644
index 00000000000..1896489d5bc
--- /dev/null
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/PrimitiveType.java
@@ -0,0 +1,33 @@
+package org.jetbrains.jet.lang.types;
+
+/**
+ * @author Stepan Koltsov
+ */
+public enum PrimitiveType {
+
+ BOOLEAN("Boolean"),
+ CHAR("Char"),
+ BYTE("Byte"),
+ SHORT("Short"),
+ INT("Int"),
+ FLOAT("Float"),
+ LONG("Long"),
+ DOUBLE("Double"),
+ ;
+
+ private final String typeName;
+ private final String arrayTypeName;
+
+ private PrimitiveType(String typeName) {
+ this.typeName = typeName;
+ this.arrayTypeName = typeName + "Array";
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public String getArrayTypeName() {
+ return arrayTypeName;
+ }
+}
diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.java
index 52622522ba4..0df6d9c4af1 100644
--- a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.java
+++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.java
@@ -68,7 +68,7 @@ public class ClosureExpressionsTypingVisitor extends ExpressionTypingVisitor {
JetType expectedType = context.expectedType;
boolean functionTypeExpected = expectedType != TypeUtils.NO_EXPECTED_TYPE && JetStandardClasses.isFunctionType(expectedType);
- FunctionDescriptorImpl functionDescriptor = createFunctionDescriptor(expression, context, functionTypeExpected);
+ NamedFunctionDescriptorImpl functionDescriptor = createFunctionDescriptor(expression, context, functionTypeExpected);
ListP.anotherJavaClass: java.lang.Class
+ get() = throw Exception()
diff --git a/compiler/testData/readClass/prop/ExtValInClass.kt b/compiler/testData/readClass/prop/ExtValInClass.kt
new file mode 100644
index 00000000000..5bdd27596da
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtValInClass.kt
@@ -0,0 +1,6 @@
+package test
+
+class ExtPropInClass {
+ val Int.itIs: Int
+ get() = this
+}
diff --git a/compiler/testData/readClass/prop/ExtValInt.kt b/compiler/testData/readClass/prop/ExtValInt.kt
new file mode 100644
index 00000000000..7a66f817fa2
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtValInt.kt
@@ -0,0 +1,4 @@
+package test
+
+val Int.itIs: Int
+ get() = this
diff --git a/compiler/testData/readClass/prop/ExtValIntCharSequence.kt b/compiler/testData/readClass/prop/ExtValIntCharSequence.kt
new file mode 100644
index 00000000000..4d11a8c99f3
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtValIntCharSequence.kt
@@ -0,0 +1,6 @@
+package test
+
+import java.lang.CharSequence
+
+val Int.ggg: CharSequence
+ get() = throw Exception()
diff --git a/compiler/testData/readClass/prop/ExtValIntCharSequenceQ.kt b/compiler/testData/readClass/prop/ExtValIntCharSequenceQ.kt
new file mode 100644
index 00000000000..8c89b50f3df
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtValIntCharSequenceQ.kt
@@ -0,0 +1,6 @@
+package test
+
+import java.lang.CharSequence
+
+val Int.ggg: CharSequence?
+ get() = throw Exception()
diff --git a/compiler/testData/readClass/prop/ExtValIntListQOfIntInClass.kt b/compiler/testData/readClass/prop/ExtValIntListQOfIntInClass.kt
new file mode 100644
index 00000000000..bced635853c
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtValIntListQOfIntInClass.kt
@@ -0,0 +1,6 @@
+package test
+
+class ExtValInClass {
+ val Int.asas: java.util.List {
+ val Int.asas: P?
+ get() = throw Exception()
+}
diff --git a/compiler/testData/readClass/prop/ExtValTIntInClass.kt b/compiler/testData/readClass/prop/ExtValTIntInClass.kt
new file mode 100644
index 00000000000..b1eb29567ed
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtValTIntInClass.kt
@@ -0,0 +1,6 @@
+package test
+
+class ExtValPIntInClass {
+ val P.asas: Int
+ get() = throw Exception()
+}
diff --git a/compiler/testData/readClass/prop/ExtVarClass.kt b/compiler/testData/readClass/prop/ExtVarClass.kt
new file mode 100644
index 00000000000..f32b9564961
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtVarClass.kt
@@ -0,0 +1,5 @@
+package test
+
+var P.anotherJavaClass: java.lang.Class
+ get() = throw Exception()
+ set(p: java.lang.Class ) = throw Exception()
diff --git a/compiler/testData/readClass/prop/ExtVarInClass.kt b/compiler/testData/readClass/prop/ExtVarInClass.kt
new file mode 100644
index 00000000000..2e739bf5302
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtVarInClass.kt
@@ -0,0 +1,7 @@
+package test
+
+class ExtPropInClass {
+ var Int.itIs: Int
+ get() = throw Exception()
+ set(p: Int) = throw Exception()
+}
diff --git a/compiler/testData/readClass/prop/ExtVarInt.kt b/compiler/testData/readClass/prop/ExtVarInt.kt
new file mode 100644
index 00000000000..229a26e8dc6
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtVarInt.kt
@@ -0,0 +1,5 @@
+package test
+
+var Int.ggg: Int
+ get() = throw Exception()
+ set(p) = throw Exception()
diff --git a/compiler/testData/readClass/prop/ExtVarIntTInClass.kt b/compiler/testData/readClass/prop/ExtVarIntTInClass.kt
new file mode 100644
index 00000000000..55ff0f66db4
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtVarIntTInClass.kt
@@ -0,0 +1,7 @@
+package test
+
+class ExtValInClass {
+ var Int.asas: P
+ get() = throw Exception()
+ set(p: P) = throw Exception()
+}
diff --git a/compiler/testData/readClass/prop/ExtVarIntTQInClass.kt b/compiler/testData/readClass/prop/ExtVarIntTQInClass.kt
new file mode 100644
index 00000000000..ea0a6d7b512
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtVarIntTQInClass.kt
@@ -0,0 +1,7 @@
+package test
+
+class ExtValInClass {
+ var Int.asas: P?
+ get() = throw Exception()
+ set(p: P?) = throw Exception()
+}
diff --git a/compiler/testData/readClass/prop/ExtVarMapPQInt.kt b/compiler/testData/readClass/prop/ExtVarMapPQInt.kt
new file mode 100644
index 00000000000..4abab48e497
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtVarMapPQInt.kt
@@ -0,0 +1,7 @@
+package test
+
+import java.util.Map
+
+var Map .asas: Int
+ get() = throw Exception()
+ set(i: Int) = throw Exception()
diff --git a/compiler/testData/readClass/prop/ExtVarTIntInClass.kt b/compiler/testData/readClass/prop/ExtVarTIntInClass.kt
new file mode 100644
index 00000000000..944b4167060
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtVarTIntInClass.kt
@@ -0,0 +1,7 @@
+package test
+
+class ExtValPIntInClass {
+ var P.asas: Int
+ get() = throw Exception()
+ set(p: Int) = throw Exception()
+}
diff --git a/compiler/testData/readClass/prop/ExtVarTQIntInClass.kt b/compiler/testData/readClass/prop/ExtVarTQIntInClass.kt
new file mode 100644
index 00000000000..78b6b63aa93
--- /dev/null
+++ b/compiler/testData/readClass/prop/ExtVarTQIntInClass.kt
@@ -0,0 +1,7 @@
+package test
+
+class ExtValPIntInClass {
+ var P?.asas: Int
+ get() = throw Exception()
+ set(p: Int) = throw Exception()
+}
diff --git a/compiler/testData/readClass/type/ArrayOfCharSequence.kt b/compiler/testData/readClass/type/ArrayOfCharSequence.kt
new file mode 100644
index 00000000000..8ba5d0f0661
--- /dev/null
+++ b/compiler/testData/readClass/type/ArrayOfCharSequence.kt
@@ -0,0 +1,3 @@
+package test
+
+fun nothing(): Array foo(vararg tail: P) = 1
+
+// method: namespace::foo
+// jvm signature: (Ljet/TypeInfo;[Ljava/lang/Object;)I
+// generic signature:
+
+
+
\ No newline at end of file
diff --git a/idea/src/META-INF/plugin.xml b/idea/src/META-INF/plugin.xml
index 5d01613d996..94428276631 100644
--- a/idea/src/META-INF/plugin.xml
+++ b/idea/src/META-INF/plugin.xml
@@ -14,6 +14,10 @@
+
+
+
+ This is a built-in template used by IDEA each time you create a
+ Kotlin file
+
+
+