2014-11-17 2 views
4

나는 점점 오전 내가 TSC를 실행하는 WebStorm 파일 감시자 사용하여 컴파일 할 때 가끔 다음타이프 라이터 1.3 때로는주는 잘못된 유형의 잘못된 일치 오류

../paragraph/paragraph.ts(193,29): error TS2345: Argument of type 'TYPE' is not assignable to parameter of type 'TYPE'. 
../paragraph/paragraph.ts(255,75): error TS2345: Argument of type 'Paragraph' is not assignable to parameter of type 'Paragraph'. 
../paragraph/tab.ts(241,37): error TS2345: Argument of type 'ArrayList<TabAttributes>' is not assignable to parameter of type 'ArrayList<TabAttributes>'. 
    Type 'TabAttributes' is not assignable to type 'TabAttributes'. 

내가 20이의를 얻고있다. VS2013을 사용하여 컴파일 할 때 문제가 없습니다. 코드를 실행할 때 아무런 문제가 없습니다. 하지만 컴파일러는 이런 것들을 잔뜩 질식시키는 것 같습니다. 이것은 typescript 1.3으로 업그레이드했을 때만 시작되었습니다.

명확화 : VisualStudio를 사용하여 모두 빌드 할 때 typescript 컴파일에서 오류나 경고를받지 못합니다. WebStorm이 컴파일되면 때때로 얻습니다. 그러나 WebStorm은 컴파일러 출력을 다시 디스플레이에 전달합니다.

무슨 일 이니?

업데이트 - 여기 DOS 상자에 컴파일 출력입니다 : 내가 대답 건너했습니다 꽤 많은 시간 동안 파고 후 1.3로 업데이트 할 때 나는 똑같은 문제를 했어

C:\src\jenova\Dev\Merge\AutoTagWeb\client\scripts\layout\document\elements\parag 
raph>tsc --target ES5 --module amd --sourcemap paragraph.ts 
../../../document/elements/paragraph/line.ts(127,41): error TS2339: Property 'LI 
NE' does not exist on type 'typeof TYPE'. 
../../../document/elements/position.ts(75,40): error TS2339: Property 'POSITION' 
does not exist on type 'typeof TYPE'. 
../../../document/elements/position.ts(184,59): error TS2339: Property 'ABSOLUTE 
_POSITION' does not exist on type 'typeof TYPE'. 
../../../document/elements/position.ts(193,40): error TS2339: Property 'ABSOLUTE 
_POSITION' does not exist on type 'typeof TYPE'. 
../../../document/elements/run/run.ts(57,40): error TS2339: Property 'RUN_ELEMEN 
T' does not exist on type 'typeof TYPE'. 
../../../document/list-body.ts(537,41): error TS2339: Property 'LINE' does not e 
xist on type 'typeof TYPE'. 
../../../final-format.ts(719,62): error TS2339: Property 'LINE' does not exist o 
n type 'typeof TYPE'. 
../../../handlers/para-handler.ts(510,52): error TS2339: Property 'RUN_ELEMENT' 
does not exist on type 'typeof TYPE'. 
../../../handlers/para-handler.ts(522,51): error TS2339: Property 'BLOCK' does n 
ot exist on type 'typeof TYPE'. 
../../../handlers/para-handler.ts(565,52): error TS2339: Property 'RUN_ELEMENT' 
does not exist on type 'typeof TYPE'. 
../../../handlers/para-handler.ts(570,52): error TS2339: Property 'BLOCK' does n 
ot exist on type 'typeof TYPE'. 
../../../handlers/text-handler.ts(63,42): error TS2339: Property 'RUN_ELEMENT' d 
oes not exist on type 'typeof TYPE'. 
../../../handlers/text-handler.ts(99,42): error TS2339: Property 'LINE' does not 
exist on type 'typeof TYPE'. 
../../../handlers/text-handler.ts(108,41): error TS2339: Property 'BLOCK' does n 
ot exist on type 'typeof TYPE'. 
../../../handlers/text-handler.ts(561,39): error TS2339: Property 'POSITION' doe 
s not exist on type 'typeof TYPE'. 
../../../handlers/text-handler.ts(571,39): error TS2339: Property 'LINE' does no 
t exist on type 'typeof TYPE'. 
../../elements/paragraph/line.ts(127,41): error TS2339: Property 'LINE' does not 
exist on type 'typeof TYPE'. 
../../elements/position.ts(75,40): error TS2339: Property 'POSITION' does not ex 
ist on type 'typeof TYPE'. 
../../elements/position.ts(184,59): error TS2339: Property 'ABSOLUTE_POSITION' d 
oes not exist on type 'typeof TYPE'. 
../../elements/position.ts(193,40): error TS2339: Property 'ABSOLUTE_POSITION' d 
oes not exist on type 'typeof TYPE'. 
../../elements/run/run.ts(57,40): error TS2339: Property 'RUN_ELEMENT' does not 
exist on type 'typeof TYPE'. 
../../list-body.ts(537,41): error TS2339: Property 'LINE' does not exist on type 
'typeof TYPE'. 
../paragraph/line.ts(127,41): error TS2339: Property 'LINE' does not exist on ty 
pe 'typeof TYPE'. 
../paragraph/paragraph-properties.ts(429,14): error TS2421: Class 'ParagraphProp 
ertyValues' incorrectly implements interface 'IParagraphPropertyValues': 
    Types of property 'parent' are incompatible: 
    Type 'Paragraph' is not assignable to type 'IParagraph': 
     Types of property 'type' are incompatible: 
     Type 'TYPE' is not assignable to type 'TYPE'. 
../paragraph/paragraph.ts(94,14): error TS2416: Class 'Paragraph' incorrectly ex 
tends base class 'Line': 
    Types of property 'isType' are incompatible: 
    Type '(type: TYPE) => boolean' is not assignable to type '(type: TYPE) => bo 
olean': 
     Types of parameters 'type' and 'type' are incompatible: 
     Type 'TYPE' is not assignable to type 'TYPE'. 
../paragraph/paragraph.ts(94,14): error TS2421: Class 'Paragraph' incorrectly im 
plements interface 'IParagraph': 
    Types of property 'props' are incompatible: 
    Type 'ParagraphPropertyValues' is not assignable to type 'IParagraphProperty 
Values'. 
../paragraph/paragraph.ts(193,29): error TS2345: Argument of type 'TYPE' is not 
assignable to parameter of type 'TYPE'. 
../paragraph/paragraph.ts(230,13): error TS2323: Type 'Paragraph' is not assigna 
ble to type 'IParagraph'. 
../paragraph/paragraph.ts(248,34): error TS2353: Neither type 'IParagraphPropert 
yValues' nor type 'ParagraphPropertyValues' is assignable to the other: 
    Property 'className' is missing in type 'IParagraphPropertyValues'. 
../paragraph/paragraph.ts(255,75): error TS2345: Argument of type 'Paragraph' is 
not assignable to parameter of type 'Paragraph'. 
../paragraph/paragraph.ts(274,22): error TS2345: Argument of type 'Paragraph' is 
not assignable to parameter of type 'Line'. 
../paragraph/paragraph.ts(306,30): error TS2345: Argument of type 'Paragraph' is 
not assignable to parameter of type 'IParagraph'. 
../paragraph/paragraph.ts(385,13): error TS2365: Operator '!==' cannot be applie 
d to types 'SUFFIX' and 'SUFFIX'. 
../paragraph/paragraph.ts(386,17): error TS2365: Operator '===' cannot be applie 
d to types 'SUFFIX' and 'SUFFIX'. 
../paragraph/paragraph.ts(562,41): error TS2345: Argument of type 'Paragraph' is 
not assignable to parameter of type 'Line'. 
../paragraph/paragraph.ts(602,28): error TS2353: Neither type 'Element' nor type 
'RunProperties' is assignable to the other: 
    Types of property 'type' are incompatible: 
    Type 'TYPE' is not assignable to type 'TYPE'. 
../paragraph/paragraph.ts(619,36): error TS2345: Argument of type 'RunProperties 
' is not assignable to parameter of type 'Element[]'. 
../paragraph/paragraph.ts(622,51): error TS2345: Argument of type 'RunProperties 
' is not assignable to parameter of type 'Element[]'. 
../paragraph/paragraph.ts(636,15): error TS2353: Neither type 'Element' nor type 
'RunPropertyValues' is assignable to the other: 
    Property 'parent' is missing in type 'Element'. 
../paragraph/paragraph.ts(695,16): error TS2353: Neither type 'Element' nor type 
'Paragraph' is assignable to the other: 
    Property 'docHeader' is missing in type 'Element'. 
../paragraph/tab.ts(241,37): error TS2345: Argument of type 'ArrayList<TabAttrib 
utes>' is not assignable to parameter of type 'ArrayList<TabAttributes>'. 
    Type 'TabAttributes' is not assignable to type 'TabAttributes'. 
../paragraph/tab.ts(295,60): error TS2345: Argument of type 'ArrayList<TabAttrib 
utes>' is not assignable to parameter of type 'ArrayList<TabAttributes>'. 
    Type 'TabAttributes' is not assignable to type 'TabAttributes'. 
../position.ts(75,40): error TS2339: Property 'POSITION' does not exist on type 
'typeof TYPE'. 
../position.ts(184,59): error TS2339: Property 'ABSOLUTE_POSITION' does not exis 
t on type 'typeof TYPE'. 
../position.ts(193,40): error TS2339: Property 'ABSOLUTE_POSITION' does not exis 
t on type 'typeof TYPE'. 
../run/run-properties.ts(729,46): error TS2345: Argument of type 'REGION' is not 
assignable to parameter of type 'REGION'. 
../run/run.ts(57,40): error TS2339: Property 'RUN_ELEMENT' does not exist on typ 
e 'typeof TYPE'. 
../section.ts(395,59): error TS2345: Argument of type 'Section' is not assignabl 
e to parameter of type 'Section'. 
../section.ts(792,67): error TS2345: Argument of type 'Section' is not assignabl 
e to parameter of type 'Section'. 
../table/table.ts(133,16): error TS2353: Neither type 'Element' nor type 'Row' i 
s assignable to the other: 
    Property 'props' is missing in type 'Element'. 
line.ts(127,41): error TS2339: Property 'LINE' does not exist on type 'typeof TY 
PE'. 
paragraph-properties.ts(429,14): error TS2421: Class 'ParagraphPropertyValues' i 
ncorrectly implements interface 'IParagraphPropertyValues': 
    Types of property 'parent' are incompatible: 
    Type 'Paragraph' is not assignable to type 'IParagraph': 
     Types of property 'type' are incompatible: 
     Type 'TYPE' is not assignable to type 'TYPE'. 
paragraph.ts(94,14): error TS2416: Class 'Paragraph' incorrectly extends base cl 
ass 'Line': 
    Types of property 'isType' are incompatible: 
    Type '(type: TYPE) => boolean' is not assignable to type '(type: TYPE) => bo 
olean': 
     Types of parameters 'type' and 'type' are incompatible: 
     Type 'TYPE' is not assignable to type 'TYPE'. 
paragraph.ts(94,14): error TS2421: Class 'Paragraph' incorrectly implements inte 
rface 'IParagraph': 
    Types of property 'props' are incompatible: 
    Type 'ParagraphPropertyValues' is not assignable to type 'IParagraphProperty 
Values'. 
paragraph.ts(193,29): error TS2345: Argument of type 'TYPE' is not assignable to 
parameter of type 'TYPE'. 
paragraph.ts(230,13): error TS2323: Type 'Paragraph' is not assignable to type ' 
IParagraph'. 
paragraph.ts(248,34): error TS2353: Neither type 'IParagraphPropertyValues' nor 
type 'ParagraphPropertyValues' is assignable to the other: 
    Property 'className' is missing in type 'IParagraphPropertyValues'. 
paragraph.ts(255,75): error TS2345: Argument of type 'Paragraph' is not assignab 
le to parameter of type 'Paragraph'. 
paragraph.ts(274,22): error TS2345: Argument of type 'Paragraph' is not assignab 
le to parameter of type 'Line'. 
paragraph.ts(306,30): error TS2345: Argument of type 'Paragraph' is not assignab 
le to parameter of type 'IParagraph'. 
paragraph.ts(385,13): error TS2365: Operator '!==' cannot be applied to types 'S 
UFFIX' and 'SUFFIX'. 
paragraph.ts(386,17): error TS2365: Operator '===' cannot be applied to types 'S 
UFFIX' and 'SUFFIX'. 
paragraph.ts(562,41): error TS2345: Argument of type 'Paragraph' is not assignab 
le to parameter of type 'Line'. 
paragraph.ts(602,28): error TS2352: Neither type 'Element' nor type 'RunProperti 
es' is assignable to the other. 
paragraph.ts(619,36): error TS2345: Argument of type 'RunProperties' is not assi 
gnable to parameter of type 'Element[]'. 
paragraph.ts(622,51): error TS2345: Argument of type 'RunProperties' is not assi 
gnable to parameter of type 'Element[]'. 
paragraph.ts(636,15): error TS2352: Neither type 'Element' nor type 'RunProperty 
Values' is assignable to the other. 
paragraph.ts(695,16): error TS2353: Neither type 'Element' nor type 'Paragraph' 
is assignable to the other: 
    Property 'docHeader' is missing in type 'Element'. 
tab.ts(241,37): error TS2345: Argument of type 'ArrayList<TabAttributes>' is not 
assignable to parameter of type 'ArrayList<TabAttributes>'. 
    Type 'TabAttributes' is not assignable to type 'TabAttributes'. 
tab.ts(295,60): error TS2345: Argument of type 'ArrayList<TabAttributes>' is not 
assignable to parameter of type 'ArrayList<TabAttributes>'. 
    Type 'TabAttributes' is not assignable to type 'TabAttributes'. 
+0

비주얼 스튜디오를 통해 TS 1.3 컴파일러를 실행하면 웹 스타트에서 실행할 때만 해당 메시지가 표시되지 않습니다. 또는 당신은 Visual Studio에서 파일을 저장할 때 여전히 js 파일을 올바르게 만들지 만 오류가 있다는 것을 의미합니까? – John

+0

@ 존 - 명확히하기 위해 Q를 업데이트했습니다. –

+0

명령 줄 컴파일러 (tsc.exe 또는 tsc.js)에서 이러한 오류를 재현 할 수 있습니까? –

답변

3

가.

1.3 컴파일러는 분명히 상대 경로를 좋아하지 않으므로 모든 컴파일러 인수에 절대 경로 만 사용해야합니다.

특별히 나를위한 문제는 TypeScript 파일 감시자 인수의 $FileName$ (상대 경로) 매크로입니다.
$FilePath$ (절대 경로)으로 변경하면 해결됩니다.

+0

고맙습니다 !!!!!!! –