121 lines
No EOL
3.2 KiB
Text
121 lines
No EOL
3.2 KiB
Text
==== tests/cases/conformance/internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts (21 errors) ====
|
|
// All of these should be an error
|
|
|
|
module Y {
|
|
public class A { s: string }
|
|
~~~~~~
|
|
!!! 'public' modifier cannot appear on a module element.
|
|
|
|
public class BB<T> extends A {
|
|
~~~~~~
|
|
!!! 'public' modifier cannot appear on a module element.
|
|
id: number;
|
|
}
|
|
}
|
|
|
|
module Y2 {
|
|
public class AA<T> { s: T }
|
|
~~~~~~
|
|
!!! 'public' modifier cannot appear on a module element.
|
|
public interface I { id: number }
|
|
~~~~~~
|
|
!!! 'public' modifier cannot appear on a module element.
|
|
|
|
public class B extends AA<string> implements I { id: number }
|
|
~~~~~~
|
|
!!! 'public' modifier cannot appear on a module element.
|
|
}
|
|
|
|
module Y3 {
|
|
public module Module {
|
|
~~~~~~
|
|
!!! 'public' modifier cannot appear on a module element.
|
|
class A { s: string }
|
|
}
|
|
}
|
|
|
|
module Y4 {
|
|
public enum Color { Blue, Red }
|
|
~~~~~~
|
|
!!! 'public' modifier cannot appear on a module element.
|
|
}
|
|
|
|
module YY {
|
|
private class A { s: string }
|
|
~~~~~~~
|
|
!!! 'private' modifier cannot appear on a module element.
|
|
|
|
private class BB<T> extends A {
|
|
~~~~~~~
|
|
!!! 'private' modifier cannot appear on a module element.
|
|
id: number;
|
|
}
|
|
}
|
|
|
|
module YY2 {
|
|
private class AA<T> { s: T }
|
|
~~~~~~~
|
|
!!! 'private' modifier cannot appear on a module element.
|
|
private interface I { id: number }
|
|
~~~~~~~
|
|
!!! 'private' modifier cannot appear on a module element.
|
|
|
|
private class B extends AA<string> implements I { id: number }
|
|
~~~~~~~
|
|
!!! 'private' modifier cannot appear on a module element.
|
|
}
|
|
|
|
module YY3 {
|
|
private module Module {
|
|
~~~~~~~
|
|
!!! 'private' modifier cannot appear on a module element.
|
|
class A { s: string }
|
|
}
|
|
}
|
|
|
|
module YY4 {
|
|
private enum Color { Blue, Red }
|
|
~~~~~~~
|
|
!!! 'private' modifier cannot appear on a module element.
|
|
}
|
|
|
|
|
|
module YYY {
|
|
static class A { s: string }
|
|
~~~~~~
|
|
!!! 'static' modifier cannot appear on a module element.
|
|
|
|
static class BB<T> extends A {
|
|
~~~~~~
|
|
!!! 'static' modifier cannot appear on a module element.
|
|
id: number;
|
|
}
|
|
}
|
|
|
|
module YYY2 {
|
|
static class AA<T> { s: T }
|
|
~~~~~~
|
|
!!! 'static' modifier cannot appear on a module element.
|
|
static interface I { id: number }
|
|
~~~~~~
|
|
!!! 'static' modifier cannot appear on a module element.
|
|
|
|
static class B extends AA<string> implements I { id: number }
|
|
~~~~~~
|
|
!!! 'static' modifier cannot appear on a module element.
|
|
}
|
|
|
|
module YYY3 {
|
|
static module Module {
|
|
~~~~~~
|
|
!!! 'static' modifier cannot appear on a module element.
|
|
class A { s: string }
|
|
}
|
|
}
|
|
|
|
module YYY4 {
|
|
static enum Color { Blue, Red }
|
|
~~~~~~
|
|
!!! 'static' modifier cannot appear on a module element.
|
|
}
|
|
|