hylo icon indicating copy to clipboard operation
hylo copied to clipboard

Name resolution in generic arguments list fails in extensions

Open kyouko-taiga opened this issue 1 year ago • 0 comments

Reproducer:

type A<X> {
  public memberwise init
}

typealias B<Y> = A<Y>

trait T {}

conformance B: T {
  public fun h() {
    let p = self
    check<A<Y>>(p) // <- fails
  }
}

fun check<T>(_ x: T) {}

The type checker incorrectly opens Y as a fresh variable in A<Y>. Name resolution should conclude that Y has to be skolemized, as its use occurs in a scope bridged to A's declaration.

kyouko-taiga avatar May 21 '23 14:05 kyouko-taiga