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

rokucommunity / brighterscript / #13683

03 Feb 2025 04:19PM UTC coverage: 86.753% (-1.4%) from 88.185%
#13683

push

web-flow
Merge 34e72243e into 4afb6f658

12476 of 15203 branches covered (82.06%)

Branch coverage included in aggregate %.

7751 of 8408 new or added lines in 101 files covered. (92.19%)

85 existing lines in 17 files now uncovered.

13398 of 14622 relevant lines covered (91.63%)

34302.41 hits per line

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

96.43
/src/types/DynamicType.ts
1
import type { GetTypeOptions, TypeCompatibilityData } from '../interfaces';
2
import { isDynamicType, isUninitializedType, isVoidType } 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
211✔
10
    ) {
11
        super();
211✔
12
    }
13

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

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

18
    public isBuiltIn = true;
211✔
19

20
    get returnType() {
21
        return DynamicType.instance;
516✔
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
        if (isVoidType(targetType) || isUninitializedType(targetType)) {
3,831✔
35
            return false;
1✔
36
        }
37
        return !!targetType;
3,830✔
38
    }
39

40
    public toString() {
41
        return this.typeText ?? 'dynamic';
5,224✔
42
    }
43

44
    public toTypeString(): string {
45
        return this.toString();
10✔
46
    }
47

48
    public isEqual(targetType: BscType) {
49
        return isDynamicType(targetType);
51✔
50
    }
51

52
    getMemberType(memberName: string, options: GetTypeOptions) {
53
        return DynamicType.instance;
639✔
54
    }
55

56

57
}
58

59
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

© 2026 Coveralls, Inc