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

rokucommunity / brighterscript / #12715

14 Jun 2024 08:20PM UTC coverage: 85.629% (-2.3%) from 87.936%
#12715

push

web-flow
Merge 94311dc0a into 42db50190

10808 of 13500 branches covered (80.06%)

Branch coverage included in aggregate %.

6557 of 7163 new or added lines in 96 files covered. (91.54%)

83 existing lines in 17 files now uncovered.

12270 of 13451 relevant lines covered (91.22%)

26531.5 hits per line

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

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

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

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

18
    get returnType() {
19
        return DynamicType.instance;
514✔
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
        return !!targetType;
319✔
33
    }
34

35
    public toString() {
36
        return this.typeText ?? 'dynamic';
4,377✔
37
    }
38

39
    public toTypeString(): string {
40
        return this.toString();
8✔
41
    }
42

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

47
    getMemberType(memberName: string, options: GetTypeOptions) {
48
        return DynamicType.instance;
549✔
49
    }
50
}
51

52
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