Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,38 +1,12 @@
|
||||
package jet
|
||||
|
||||
package typeinfo {
|
||||
class TypeInfo<out T> {
|
||||
fun isSubtypeOf(other : TypeInfo<*>) : Boolean
|
||||
fun isInstance(obj : Any?) : Boolean
|
||||
}
|
||||
|
||||
fun typeinfo<T>() : TypeInfo<T>
|
||||
fun typeinfo<T>(expression : T) : TypeInfo<T>
|
||||
class TypeInfo<out T> {
|
||||
fun isSubtypeOf(other : TypeInfo<*>) : Boolean
|
||||
fun isInstance(obj : Any?) : Boolean
|
||||
}
|
||||
|
||||
package io {
|
||||
fun print(message : Any?)
|
||||
fun print(message : Int)
|
||||
fun print(message : Long)
|
||||
fun print(message : Byte)
|
||||
fun print(message : Short)
|
||||
fun print(message : Char)
|
||||
fun print(message : Boolean)
|
||||
fun print(message : Float)
|
||||
fun print(message : Double)
|
||||
|
||||
fun println(message : Any?)
|
||||
fun println(message : Int)
|
||||
fun println(message : Long)
|
||||
fun println(message : Byte)
|
||||
fun println(message : Short)
|
||||
fun println(message : Char)
|
||||
fun println(message : Boolean)
|
||||
fun println(message : Float)
|
||||
fun println(message : Double)
|
||||
|
||||
fun readLine() : String?
|
||||
}
|
||||
fun typeinfo<T>() : TypeInfo<T>
|
||||
fun typeinfo<T>(expression : T) : TypeInfo<T>
|
||||
|
||||
fun <R> Any.synchronized(block : () -> R) : R
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public interface Errors {
|
||||
DiagnosticWithParameterFactory<JetModifierList, JetKeywordToken> REDUNDANT_MODIFIER_IN_GETTER = DiagnosticWithParameterFactory.create(WARNING, "Visibility modifiers are redundant in getter", DiagnosticParameters.MODIFIER);
|
||||
SimplePsiElementOnlyDiagnosticFactory<JetClass> TRAIT_CAN_NOT_BE_FINAL = SimplePsiElementOnlyDiagnosticFactory.create(ERROR, "Trait can not be final");
|
||||
SimpleDiagnosticFactory SAFE_CALLS_ARE_NOT_ALLOWED_ON_NAMESPACES = SimpleDiagnosticFactory.create(ERROR, "Safe calls are not allowed on namespaces");
|
||||
SimpleDiagnosticFactory TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM = SimpleDiagnosticFactory.create(ERROR, "Type checking has run into a recursive problem"); // TODO: message
|
||||
SimpleDiagnosticFactory TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM = SimpleDiagnosticFactory.create(ERROR, "Type checking has run into a recursive problem. Easiest workaround: specify types of your declarations explicitly"); // TODO: message
|
||||
SimpleDiagnosticFactory RETURN_NOT_ALLOWED = SimpleDiagnosticFactory.create(ERROR, "'return' is not allowed here");
|
||||
SimpleDiagnosticFactory PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE = SimpleDiagnosticFactory.create(ERROR, "Projections are not allowed for immediate arguments of a supertype");
|
||||
SimpleDiagnosticFactory LABEL_NAME_CLASH = SimpleDiagnosticFactory.create(WARNING, "There is more than one label with such a name in this scope");
|
||||
|
||||
@@ -235,10 +235,11 @@ public class JetParsing extends AbstractJetParsing {
|
||||
|
||||
IElementType keywordToken = tt();
|
||||
JetNodeType declType = null;
|
||||
if (keywordToken == NAMESPACE_KEYWORD) {
|
||||
declType = parseNamespaceBlock();
|
||||
}
|
||||
else if (keywordToken == CLASS_KEYWORD || keywordToken == TRAIT_KEYWORD) {
|
||||
// if (keywordToken == NAMESPACE_KEYWORD) {
|
||||
// declType = parseNamespaceBlock();
|
||||
// }
|
||||
// else
|
||||
if (keywordToken == CLASS_KEYWORD || keywordToken == TRAIT_KEYWORD) {
|
||||
declType = parseClass(detector.isDetected());
|
||||
}
|
||||
else if (keywordToken == FUN_KEYWORD) {
|
||||
|
||||
@@ -7,10 +7,11 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.JetSemanticServices;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.FunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.resolve.*;
|
||||
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
|
||||
import org.jetbrains.jet.lang.resolve.BindingTraceContext;
|
||||
import org.jetbrains.jet.lang.resolve.TopDownAnalyzer;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.RedeclarationHandler;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
||||
@@ -120,7 +121,6 @@ public class JetStandardLibrary {
|
||||
private JetType tuple0Type;
|
||||
private JetType nullableStringType;
|
||||
|
||||
private NamespaceDescriptor typeInfoNamespace;
|
||||
private Set<FunctionDescriptor> typeInfoFunction;
|
||||
|
||||
private JetStandardLibrary(@NotNull Project project) {
|
||||
@@ -168,9 +168,9 @@ public class JetStandardLibrary {
|
||||
this.arrayClass = (ClassDescriptor) libraryScope.getClassifier("Array");
|
||||
|
||||
this.iterableClass = (ClassDescriptor) libraryScope.getClassifier("Iterable");
|
||||
typeInfoNamespace = libraryScope.getNamespace("typeinfo");
|
||||
this.typeInfoClass = (ClassDescriptor) typeInfoNamespace.getMemberScope().getClassifier("TypeInfo");
|
||||
typeInfoFunction = typeInfoNamespace.getMemberScope().getFunctions("typeinfo");
|
||||
// typeInfoNamespace = libraryScope.getNamespace("typeinfo");
|
||||
this.typeInfoClass = (ClassDescriptor) libraryScope.getClassifier("TypeInfo");
|
||||
this.typeInfoFunction = libraryScope.getFunctions("typeinfo");
|
||||
|
||||
this.byteType = new JetTypeImpl(getByte());
|
||||
this.charType = new JetTypeImpl(getChar());
|
||||
@@ -297,11 +297,11 @@ public class JetStandardLibrary {
|
||||
return iterableClass;
|
||||
}
|
||||
|
||||
public NamespaceDescriptor getTypeInfoNamespace() {
|
||||
initStdClasses();
|
||||
return typeInfoNamespace;
|
||||
}
|
||||
|
||||
// public NamespaceDescriptor getTypeInfoNamespace() {
|
||||
// initStdClasses();
|
||||
// return typeInfoNamespace;
|
||||
// }
|
||||
//
|
||||
public ClassDescriptor getTypeInfo() {
|
||||
initStdClasses();
|
||||
return typeInfoClass;
|
||||
|
||||
Reference in New Issue
Block a user