@@ -2672,7 +2672,7 @@ export class Compiler extends DiagnosticEmitter {
2672
2672
type = resolver . resolveType ( // reports
2673
2673
declaration . type ,
2674
2674
flow . actualFunction ,
2675
- flow . contextualTypeArguments
2675
+ makeMap ( flow . contextualTypeArguments )
2676
2676
) ;
2677
2677
if ( ! type ) continue ;
2678
2678
if ( declaration . initializer ) {
@@ -3464,7 +3464,7 @@ export class Compiler extends DiagnosticEmitter {
3464
3464
let toType = this . resolver . resolveType ( // reports
3465
3465
assert ( expression . toType ) ,
3466
3466
flow . actualFunction ,
3467
- flow . contextualTypeArguments
3467
+ makeMap ( flow . contextualTypeArguments )
3468
3468
) ;
3469
3469
if ( ! toType ) return this . module . unreachable ( ) ;
3470
3470
return this . compileExpression ( expression . expression , toType , inheritedConstraints | Constraints . CONV_EXPLICIT ) ;
@@ -7671,9 +7671,14 @@ export class Compiler extends DiagnosticEmitter {
7671
7671
// time of implementation, this seemed more useful because dynamic rhs expressions are not
7672
7672
// possible in AS anyway. also note that the code generated below must preserve side-effects of
7673
7673
// the LHS expression even when the result is a constant, i.e. return a block dropping `expr`.
7674
+ var flow = this . currentFlow ;
7674
7675
var expr = this . compileExpression ( expression . expression , this . options . usizeType ) ;
7675
7676
var actualType = this . currentType ;
7676
- var expectedType = this . resolver . resolveType ( expression . isType , this . currentFlow . actualFunction ) ;
7677
+ var expectedType = this . resolver . resolveType (
7678
+ expression . isType ,
7679
+ flow . actualFunction ,
7680
+ makeMap ( flow . contextualTypeArguments )
7681
+ ) ;
7677
7682
this . currentType = Type . bool ;
7678
7683
if ( ! expectedType ) return module . unreachable ( ) ;
7679
7684
@@ -7714,7 +7719,6 @@ export class Compiler extends DiagnosticEmitter {
7714
7719
if ( expectedType . isAssignableTo ( actualType ) ) {
7715
7720
let program = this . program ;
7716
7721
if ( ! ( actualType . isUnmanaged || expectedType . isUnmanaged ) ) {
7717
- let flow = this . currentFlow ;
7718
7722
let temp = flow . getTempLocal ( actualType ) ;
7719
7723
let instanceofInstance = assert ( program . instanceofInstance ) ;
7720
7724
this . compileFunction ( instanceofInstance ) ;
@@ -7764,7 +7768,6 @@ export class Compiler extends DiagnosticEmitter {
7764
7768
// FIXME: the temp local and the if can be removed here once flows
7765
7769
// perform null checking, which would error earlier when checking
7766
7770
// uninitialized (thus zero) `var a: A` to be an instance of something.
7767
- let flow = this . currentFlow ;
7768
7771
let temp = flow . getTempLocal ( actualType ) ;
7769
7772
let instanceofInstance = assert ( program . instanceofInstance ) ;
7770
7773
this . compileFunction ( instanceofInstance ) ;
0 commit comments