26 lines
No EOL
757 B
Text
26 lines
No EOL
757 B
Text
==== tests/cases/compiler/overloadModifiersMustAgree.ts (5 errors) ====
|
|
class baz {
|
|
public foo();
|
|
~~~
|
|
!!! Overload signatures must all be public or private.
|
|
private foo(bar?: any) { } // error - access modifiers do not agree
|
|
}
|
|
|
|
declare function bar();
|
|
~~~
|
|
!!! Overload signatures must all be ambient or non-ambient.
|
|
export function bar(s: string);
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
!!! Function implementation expected.
|
|
~~~
|
|
!!! Duplicate identifier 'bar'.
|
|
function bar(s?: string) { }
|
|
|
|
interface I {
|
|
foo? ();
|
|
foo(s: string);
|
|
~~~
|
|
!!! Overload signatures must all be optional or required.
|
|
}
|
|
|
|
|