• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rokucommunity / brighterscript / #13308

22 Nov 2024 02:25PM UTC coverage: 86.801%. Remained the same
#13308

push

web-flow
Merge 332332a1f into 2a6afd921

11833 of 14419 branches covered (82.07%)

Branch coverage included in aggregate %.

191 of 205 new or added lines in 26 files covered. (93.17%)

201 existing lines in 18 files now uncovered.

12868 of 14038 relevant lines covered (91.67%)

32022.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.45
/src/types/DynamicType.ts
1
import type { GetTypeOptions, TypeCompatibilityData } from '../interfaces';
2
import { isDynamicType } from '../astUtils/reflection';
1✔
3
import { BscType } from './BscType';
1✔
4
import { BscTypeKind } from './BscTypeKind';
1✔
5
import { BuiltInInterfaceAdder } from './BuiltInInterfaceAdder';
1✔
6

7
export class DynamicType extends BscType {
1✔
8
    constructor(
9
        public typeText?: string
171✔
10
    ) {
11
        super();
171✔
12
    }
13

14
    public readonly kind = BscTypeKind.DynamicType;
171✔
15

16
    public static readonly instance = new DynamicType();
1✔
17

18
    public isBuiltIn = true;
171✔
19

20
    get returnType() {
21
        return DynamicType.instance;
514✔
22
    }
23

24
    public isAssignableTo(targetType: BscType) {
25
        //everything can be dynamic, so as long as a type is provided, this is true
UNCOV
26
        return !!targetType;
×
27
    }
28

29
    /**
30
     * The dynamic type is convertible to everything.
31
     */
32
    public isTypeCompatible(targetType: BscType, data?: TypeCompatibilityData) {
33
        //everything can be dynamic, so as long as a type is provided, this is true
34
        return !!targetType;
359✔
35
    }
36

37
    public toString() {
38
        return this.typeText ?? 'dynamic';
4,986✔
39
    }
40

41
    public toTypeString(): string {
42
        return this.toString();
10✔
43
    }
44

45
    public isEqual(targetType: BscType) {
46
        return isDynamicType(targetType);
41✔
47
    }
48

49
    getMemberType(memberName: string, options: GetTypeOptions) {
50
        return DynamicType.instance;
619✔
51
    }
52
}
53

54
BuiltInInterfaceAdder.primitiveTypeInstanceCache.set('dynamic', DynamicType.instance);
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc