Error for naming an interface 'symbol'

This commit is contained in:
Jason Freeman 2015-02-16 10:44:30 -08:00
parent 65d831e8b3
commit ac829a8384
4 changed files with 14 additions and 0 deletions

View file

@ -8903,6 +8903,7 @@ module ts {
case "number":
case "boolean":
case "string":
case "symbol":
case "void":
error(name, message, (<Identifier>name).text);
}

View file

@ -0,0 +1,7 @@
tests/cases/conformance/es6/Symbols/symbolType20.ts(1,11): error TS2427: Interface name cannot be 'symbol'
==== tests/cases/conformance/es6/Symbols/symbolType20.ts (1 errors) ====
interface symbol { }
~~~~~~
!!! error TS2427: Interface name cannot be 'symbol'

View file

@ -0,0 +1,4 @@
//// [symbolType20.ts]
interface symbol { }
//// [symbolType20.js]

View file

@ -0,0 +1,2 @@
//@target: ES6
interface symbol { }