Introduce KotlinTypeFactory

This commit is contained in:
Stanislav Erokhin
2016-05-20 19:24:32 +03:00
parent 8c6dd95e3f
commit 3a451744c5
29 changed files with 136 additions and 110 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -58,12 +58,11 @@ fun KotlinType.approximateFlexibleTypes(preferNotNull: Boolean = false): KotlinT
return approximation
}
return KotlinTypeImpl.create(
annotations,
constructor,
isMarkedNullable,
arguments.map { it.substitute { type -> type.approximateFlexibleTypes(preferNotNull = true) } },
ErrorUtils.createErrorScope("This type is not supposed to be used in member resolution", true)
return KotlinTypeFactory.simpleType(annotations,
constructor,
arguments.map { it.substitute { type -> type.approximateFlexibleTypes(preferNotNull = true) } },
isMarkedNullable,
ErrorUtils.createErrorScope("This type is not supposed to be used in member resolution", true)
)
}