Skip to content

Commit

Permalink
Psi2Ir: Bind unbound type parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Schäfer authored and gogabr committed Apr 15, 2020
1 parent 8c4fdd1 commit fc7d667
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ class DeclarationStubGenerator(
generatePropertyStub(descriptor)
is TypeAliasDescriptor ->
generateTypeAliasStub(descriptor)
is TypeParameterDescriptor ->
generateOrGetTypeParameterStub(descriptor)
else ->
throw AssertionError("Unexpected member descriptor: $descriptor")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ private val SymbolTable.allUnbound: List<IrSymbol>
r.addAll(unboundSimpleFunctions)
r.addAll(unboundProperties)
r.addAll(unboundTypeAliases)
r.addAll(unboundTypeParameters)
return r
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// !LANGUAGE: -NewInference
// WITH_RUNTIME
// FILE: Base.java
import java.lang.Runnable;
import java.lang.IllegalStateException;

public class Base<T> {
public <S> S add(Base<S> value, Runnable block) { return null; }
}

// FILE: Derived.kt
class Derived<T>(val value: T) : Base<T>() {
init {
add(this) {}
}
}

fun box(): String {
return Derived("OK").value
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fc7d667

Please sign in to comment.