Skip to content

As a developer I want support for d.ts overloading spanning across the type hierarchy #2406

@mmews-n4

Description

@mmews-n4

Testcase overloading_with_superclass.n4js.xt (already in repo)

/* XPECT_SETUP org.eclipse.n4js.xpect.tests.N4jsXtTest

	File "def.d.ts" {
		export class Cls1 {
			m(event: string): this;
		}
		export class Cls2 extends Cls1 {
			m(event: number): this;
		}
	}

	END_SETUP
 */

// XPECT noerrors -->
import { Cls2 } from "def"

let cls: Cls2;

// XPECT FIXME noerrors -->
cls.m("message");

// XPECT noerrors -->
cls.m(42);

// XPECT FIXME type of 'fn' --> {function(any+=…):Cls}
// XPECT warnings --> "A reference to method m is created detached from a (correct) this-instance." at "m"
let fn = cls.m;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions