Search in sources :

Example 1 with TypeResolver

use of org.jetbrains.kotlin.resolve.TypeResolver in project kotlin by JetBrains.

the class TypeUnifierTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    ComponentProvider container = JvmResolveUtil.createContainer(getEnvironment());
    module = DslKt.getService(container, ModuleDescriptor.class);
    builtinsImportingScope = ScopeUtilsKt.chainImportingScopes(CollectionsKt.map(KotlinBuiltIns.BUILT_INS_PACKAGE_FQ_NAMES, new Function1<FqName, ImportingScope>() {

        @Override
        public ImportingScope invoke(FqName fqName) {
            return ScopeUtilsKt.memberScopeAsImportingScope(module.getPackage(fqName).getMemberScope());
        }
    }), null);
    typeResolver = DslKt.getService(container, TypeResolver.class);
    x = createTypeVariable("X");
    y = createTypeVariable("Y");
    variables = Sets.newHashSet(x.getTypeConstructor(), y.getTypeConstructor());
}
Also used : ModuleDescriptor(org.jetbrains.kotlin.descriptors.ModuleDescriptor) FqName(org.jetbrains.kotlin.name.FqName) TypeResolver(org.jetbrains.kotlin.resolve.TypeResolver) ComponentProvider(org.jetbrains.kotlin.container.ComponentProvider)

Aggregations

ComponentProvider (org.jetbrains.kotlin.container.ComponentProvider)1 ModuleDescriptor (org.jetbrains.kotlin.descriptors.ModuleDescriptor)1 FqName (org.jetbrains.kotlin.name.FqName)1 TypeResolver (org.jetbrains.kotlin.resolve.TypeResolver)1