[NI] Relax requirement for stub types in builder-inference

For functions with implicit return type annotations will be replaced
 anyway in order to initialize return type, so this restriction in
 `StubType` was too strong

 #KT-30656 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2019-03-28 02:45:57 +03:00
parent b10d19dc78
commit d6db1a1b35
3 changed files with 4 additions and 6 deletions
@@ -24,9 +24,7 @@ class StubType(
override val annotations: Annotations
get() = Annotations.EMPTY
override fun replaceAnnotations(newAnnotations: Annotations): SimpleType {
error("Shouldn't be called on non-fixed type")
}
override fun replaceAnnotations(newAnnotations: Annotations): SimpleType = this
override fun makeNullableAsSpecified(newNullability: Boolean): SimpleType {
return if (newNullability == isMarkedNullable)