I’m reimplementing `SimpleFunctionBuildingContext`...
# compiler
m
I’m reimplementing
SimpleFunctionBuildingContext
because I’d like an alternative API. The
build
instance method calls
buildNamedFunction
and passes a lambda which contains the following statement
Copy code
initTypeParameterBounds(typeParameters, typeParameters)
What’s going on here? As far as I can tell, this is equivalent to
Copy code
context.initTypeParameterBounds(
    functionBuilder.typeParameters, 
    functionBuilder.typeParameters,
)
Where
context: SimpleFunctionBuildingContext
and
functionBuilder: FirNamedFunctionBuilder
.
m
@dmitriy.novozhilov But why does the function hold two references to the same object?
d
There are two parameters in this function to properly handle the case of inner classes, which see type parameters of the outer class but don't hold them. For functions all and own parameters are always the same.
m
I’ve just noticed that I pinged you again by mistake. I apologise, I’ll be more careful and thank you for the explanation!
thank you color 1