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

rokucommunity / brighterscript / #13590

13 Jan 2025 02:40PM UTC coverage: 86.911% (-1.3%) from 88.185%
#13590

push

web-flow
Merge 38702985d into 9d6ef67ba

12071 of 14663 branches covered (82.32%)

Branch coverage included in aggregate %.

90 of 94 new or added lines in 11 files covered. (95.74%)

796 existing lines in 47 files now uncovered.

13048 of 14239 relevant lines covered (91.64%)

31886.92 hits per line

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

96.3
/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
174✔
10
    ) {
11
        super();
174✔
12
    }
13

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

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

18
    get returnType() {
19
        return DynamicType.instance;
516✔
20
    }
21

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

27
    /**
28
     * The dynamic type is convertible to everything.
29
     */
30
    public isTypeCompatible(targetType: BscType, data?: TypeCompatibilityData) {
31
        //everything can be dynamic, so as long as a type is provided, this is true
32
        if (isVoidType(targetType) || isUninitializedType(targetType)) {
371✔
33
            return false;
1✔
34
        }
35
        return !!targetType;
370✔
36
    }
37

38
    public toString() {
39
        return this.typeText ?? 'dynamic';
5,057✔
40
    }
41

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

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

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

55
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