@@ -2961,8 +2961,8 @@ export class Compiler extends DiagnosticEmitter {
2961
2961
}
2962
2962
}
2963
2963
// Check if a converting to an Interface
2964
- if ( toType . is ( TypeFlags . REFERENCE ) ) {
2965
- assert ( toType . classReference != null && toType . classReference != null ) ;
2964
+ if ( toType . is ( TypeFlags . REFERENCE ) && ! toType . isFunction ) {
2965
+ assert ( toType . classReference != null && fromType . classReference != null ) ;
2966
2966
if ( toType . classReference ! . kind == ElementKind . INTERFACE ) {
2967
2967
( < Interface > toType . classReference ! ) . implementers . add ( fromType . classReference ! ) ;
2968
2968
}
@@ -6223,11 +6223,6 @@ export class Compiler extends DiagnosticEmitter {
6223
6223
}
6224
6224
var parameterTypes = signature . parameterTypes ;
6225
6225
for ( let i = 0 ; i < numArguments ; ++ i , ++ index ) {
6226
- if ( parameterTypes [ i ] . is ( TypeFlags . REFERENCE ) ) {
6227
-
6228
- }
6229
- let arg_type = this . resolver . resolveExpression ( argumentExpressions [ i ] , this . currentFlow ) ;
6230
-
6231
6226
operands [ index ] = this . compileExpression ( argumentExpressions [ i ] , parameterTypes [ i ] ,
6232
6227
Constraints . CONV_IMPLICIT
6233
6228
) ;
@@ -9151,6 +9146,7 @@ export class Compiler extends DiagnosticEmitter {
9151
9146
9152
9147
compileVirtualTable ( ) : void {
9153
9148
const interfaces = this . program . interfaces ;
9149
+ if ( interfaces . length == 0 ) return ; //Don't create table if no interfaces present
9154
9150
const instanceMethods : Map < number , Map < number , Function > > = new Map ( ) ;
9155
9151
const interfaceMethods : Map < number , Function [ ] > = new Map ( ) ;
9156
9152
// Gather all instatiated interface methods
0 commit comments