Skip to content

Inconsistency in polymorphic 'this' typing #5492

Closed
@zhuravlikjb

Description

@zhuravlikjb
class A {
    p: A;
    c = this.p;
}

class B extends A {
    p: B;    
}

var s: B;
var k = s.c; // 'k' is 'A'
class A {
    c = this;
}

class B extends A {        
}

var s: B;
var k = s.c; // 'k' is 'B'

Metadata

Metadata

Assignees

No one assigned

    Labels

    By DesignDeprecated - use "Working as Intended" or "Design Limitation" instead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions