File: tsxAttributeResolution12.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (58 lines) | stat: -rw-r--r-- 2,169 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
tests/cases/conformance/jsx/file.tsx(25,11): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { reqd: any; }'.
  Property 'reqd' is missing in type '{}' but required in type '{ reqd: any; }'.
tests/cases/conformance/jsx/file.tsx(28,11): error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { reqd: any; }'.
  Property 'reqd' is missing in type '{}' but required in type '{ reqd: any; }'.


==== tests/cases/conformance/jsx/react.d.ts (0 errors) ====
    declare module JSX {
    	interface Element { }
    	interface IntrinsicElements {
    	}
    	interface ElementAttributesProperty {
    		props;
    	}
    	interface IntrinsicAttributes {
    		ref?: string;
    	}
    }
    
==== tests/cases/conformance/jsx/file.tsx (2 errors) ====
    declare class Component<P, S>  {
    	constructor(props?: P, context?: any);
    	setState(f: (prevState: S, props: P) => S, callback?: () => any): void;
    	setState(state: S, callback?: () => any): void;
    	forceUpdate(callBack?: () => any): void;
    	render(): JSX.Element;
    	props: P;
    	state: S;
    	context: {};
    }
    
    
    interface ComponentClass<P> {
    	new (props?: P, context?: any): Component<P, any>;
    }
    
    declare module TestMod {
    	interface TestClass extends ComponentClass<{reqd: any}> {
    	}
    	var Test: TestClass;
    }
    
    // Errors correctly
    const T = TestMod.Test;
    var t1 = <T />;
              ~
!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { reqd: any; }'.
!!! error TS2322:   Property 'reqd' is missing in type '{}' but required in type '{ reqd: any; }'.
!!! related TS2728 tests/cases/conformance/jsx/file.tsx:18:46: 'reqd' is declared here.
    
    // Should error
    var t2 = <TestMod.Test />;
              ~~~~~~~~~~~~
!!! error TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & { reqd: any; }'.
!!! error TS2322:   Property 'reqd' is missing in type '{}' but required in type '{ reqd: any; }'.
!!! related TS2728 tests/cases/conformance/jsx/file.tsx:18:46: 'reqd' is declared here.