diff --git a/src/types/BuiltInInterfaceAdder.spec.ts b/src/types/BuiltInInterfaceAdder.spec.ts index 3f5749d30..c79134611 100644 --- a/src/types/BuiltInInterfaceAdder.spec.ts +++ b/src/types/BuiltInInterfaceAdder.spec.ts @@ -85,22 +85,22 @@ describe('BuiltInInterfaceAdder', () => { expectTypeToBe(myType.getMemberType('join', { flags: SymbolTypeFlag.runtime }), TypedFunctionType); }); - it('should add members to ClassType', () => { + it('should not add members to ClassType', () => { const myType = new ClassType('Klass'); BuiltInInterfaceAdder.addBuiltInInterfacesToType(myType); - expectTypeToBe(myType.getMemberType('clear', { flags: SymbolTypeFlag.runtime }), TypedFunctionType); - expectTypeToBe(myType.getMemberType('lookUp', { flags: SymbolTypeFlag.runtime }), TypedFunctionType); + expect(myType.getMemberType('clear', { flags: SymbolTypeFlag.runtime }).isResolvable()).to.be.false; + expect(myType.getMemberType('lookUp', { flags: SymbolTypeFlag.runtime }).isResolvable()).to.be.false; }); - it('should allow classes to override built in members', () => { + it('should allow classes to override AA members', () => { const myType = new ClassType('Klass'); myType.addMember('clear', null, new BooleanType(), SymbolTypeFlag.runtime); BuiltInInterfaceAdder.addBuiltInInterfacesToType(myType); expectTypeToBe(myType.getMemberType('clear', { flags: SymbolTypeFlag.runtime }), BooleanType); }); - it('should not include members that have already been overridded', () => { + it('should not include members that have already been overrided', () => { const myType = new ClassType('Klass'); myType.addMember('clear', null, new BooleanType(), SymbolTypeFlag.runtime); BuiltInInterfaceAdder.addBuiltInInterfacesToType(myType); diff --git a/src/types/BuiltInInterfaceAdder.ts b/src/types/BuiltInInterfaceAdder.ts index 38a29f1a7..6720865f8 100644 --- a/src/types/BuiltInInterfaceAdder.ts +++ b/src/types/BuiltInInterfaceAdder.ts @@ -5,7 +5,7 @@ import type { TypedFunctionType } from './TypedFunctionType'; import type { SymbolTable } from '../SymbolTable'; import { SymbolTypeFlag } from '../SymbolTable'; import type { BscType } from './BscType'; -import { isArrayType, isAssociativeArrayType, isBooleanType, isCallableType, isClassType, isComponentType, isDoubleType, isEnumMemberType, isFloatType, isIntegerType, isInterfaceType, isInvalidType, isLongIntegerType, isStringType } from '../astUtils/reflection'; +import { isArrayType, isAssociativeArrayType, isBooleanType, isCallableType, isComponentType, isDoubleType, isEnumMemberType, isFloatType, isIntegerType, isInterfaceType, isInvalidType, isLongIntegerType, isStringType } from '../astUtils/reflection'; import type { ComponentType } from './ComponentType'; import util from '../util'; import type { UnionType } from './UnionType'; @@ -114,8 +114,6 @@ export class BuiltInInterfaceAdder { return 'roInvalid'; } else if (isCallableType(theType)) { return 'roFunction'; - } else if (isClassType(theType)) { - return 'roAssociativeArray'; } else if (isAssociativeArrayType(theType)) { return 'roAssociativeArray'; } else if (isArrayType(theType)) {