@@ -878,8 +878,8 @@ export class Compiler extends DiagnosticEmitter {
878
878
// Importing mutable globals is not supported in the MVP
879
879
} else {
880
880
this . error (
881
- DiagnosticCode . Operation_not_supported ,
882
- global . declaration . range
881
+ DiagnosticCode . Feature_0_is_not_enabled ,
882
+ global . declaration . range , "mutable-globals"
883
883
) ;
884
884
}
885
885
return false ;
@@ -1258,8 +1258,8 @@ export class Compiler extends DiagnosticEmitter {
1258
1258
let decoratorNodes = instance . decoratorNodes ;
1259
1259
let decorator = assert ( findDecorator ( DecoratorKind . EXTERNAL , decoratorNodes ) ) ;
1260
1260
this . error (
1261
- DiagnosticCode . Operation_not_supported ,
1262
- decorator . range
1261
+ DiagnosticCode . Decorator_0_is_not_valid_here ,
1262
+ decorator . range , "external"
1263
1263
) ;
1264
1264
}
1265
1265
@@ -1447,7 +1447,7 @@ export class Compiler extends DiagnosticEmitter {
1447
1447
) : void {
1448
1448
// TODO
1449
1449
this . error (
1450
- DiagnosticCode . Operation_not_supported ,
1450
+ DiagnosticCode . Not_implemented ,
1451
1451
declaration . range
1452
1452
) ;
1453
1453
}
@@ -1765,7 +1765,7 @@ export class Compiler extends DiagnosticEmitter {
1765
1765
case NodeKind . TYPEDECLARATION : {
1766
1766
// TODO: integrate inner type declaration into flow
1767
1767
this . error (
1768
- DiagnosticCode . Operation_not_supported ,
1768
+ DiagnosticCode . Not_implemented ,
1769
1769
statement . range
1770
1770
) ;
1771
1771
stmt = module . unreachable ( ) ;
@@ -1835,7 +1835,7 @@ export class Compiler extends DiagnosticEmitter {
1835
1835
var module = this . module ;
1836
1836
if ( statement . label ) {
1837
1837
this . error (
1838
- DiagnosticCode . Operation_not_supported ,
1838
+ DiagnosticCode . Not_implemented ,
1839
1839
statement . label . range
1840
1840
) ;
1841
1841
return module . unreachable ( ) ;
@@ -1869,7 +1869,7 @@ export class Compiler extends DiagnosticEmitter {
1869
1869
var label = statement . label ;
1870
1870
if ( label ) {
1871
1871
this . error (
1872
- DiagnosticCode . Operation_not_supported ,
1872
+ DiagnosticCode . Not_implemented ,
1873
1873
label . range
1874
1874
) ;
1875
1875
return module . unreachable ( ) ;
@@ -2415,7 +2415,7 @@ export class Compiler extends DiagnosticEmitter {
2415
2415
// TODO: can't yet support something like: try { return ... } finally { ... }
2416
2416
// worthwhile to investigate lowering returns to block results (here)?
2417
2417
this . error (
2418
- DiagnosticCode . Operation_not_supported ,
2418
+ DiagnosticCode . Not_implemented ,
2419
2419
statement . range
2420
2420
) ;
2421
2421
return this . module . unreachable ( ) ;
@@ -2859,7 +2859,7 @@ export class Compiler extends DiagnosticEmitter {
2859
2859
}
2860
2860
default : {
2861
2861
this . error (
2862
- DiagnosticCode . Operation_not_supported ,
2862
+ DiagnosticCode . Not_implemented ,
2863
2863
expression . range
2864
2864
) ;
2865
2865
expr = this . module . unreachable ( ) ;
@@ -3651,7 +3651,7 @@ export class Compiler extends DiagnosticEmitter {
3651
3651
case TypeKind . ANYREF : {
3652
3652
// TODO: ref.eq
3653
3653
this . error (
3654
- DiagnosticCode . Operation_not_supported ,
3654
+ DiagnosticCode . Not_implemented ,
3655
3655
expression . range
3656
3656
) ;
3657
3657
expr = module . unreachable ( ) ;
@@ -3748,7 +3748,7 @@ export class Compiler extends DiagnosticEmitter {
3748
3748
case TypeKind . ANYREF : {
3749
3749
// TODO: !ref.eq
3750
3750
this . error (
3751
- DiagnosticCode . Operation_not_supported ,
3751
+ DiagnosticCode . Not_implemented ,
3752
3752
expression . range
3753
3753
) ;
3754
3754
expr = module . unreachable ( ) ;
@@ -5250,7 +5250,7 @@ export class Compiler extends DiagnosticEmitter {
5250
5250
}
5251
5251
default : {
5252
5252
this . error (
5253
- DiagnosticCode . Operation_not_supported ,
5253
+ DiagnosticCode . Not_implemented ,
5254
5254
expression . range
5255
5255
) ;
5256
5256
return this . module . unreachable ( ) ;
@@ -5445,7 +5445,7 @@ export class Compiler extends DiagnosticEmitter {
5445
5445
}
5446
5446
}
5447
5447
this . error (
5448
- DiagnosticCode . Operation_not_supported ,
5448
+ DiagnosticCode . Not_implemented ,
5449
5449
valueExpression . range
5450
5450
) ;
5451
5451
return module . unreachable ( ) ;
@@ -5999,10 +5999,18 @@ export class Compiler extends DiagnosticEmitter {
5999
5999
6000
6000
// not supported
6001
6001
default : {
6002
- this . error (
6003
- DiagnosticCode . Operation_not_supported ,
6004
- expression . range
6005
- ) ;
6002
+ let type = this . resolver . getTypeOfElement ( target ) ;
6003
+ if ( type ) {
6004
+ this . error (
6005
+ DiagnosticCode . Type_0_has_no_call_signatures ,
6006
+ expression . range , type . toString ( )
6007
+ ) ;
6008
+ } else {
6009
+ this . error (
6010
+ DiagnosticCode . Expression_cannot_be_represented_by_a_type ,
6011
+ expression . range
6012
+ ) ;
6013
+ }
6006
6014
return module . unreachable ( ) ;
6007
6015
}
6008
6016
}
@@ -6046,22 +6054,14 @@ export class Compiler extends DiagnosticEmitter {
6046
6054
}
6047
6055
6048
6056
// now compile the builtin, which usually returns a block of code that replaces the call.
6049
- var expr = compileBuiltinCall (
6057
+ return compileBuiltinCall (
6050
6058
this ,
6051
6059
prototype ,
6052
6060
typeArguments ,
6053
6061
expression . arguments ,
6054
6062
contextualType ,
6055
6063
expression
6056
6064
) ;
6057
- if ( ! expr ) {
6058
- this . error (
6059
- DiagnosticCode . Operation_not_supported ,
6060
- expression . range
6061
- ) ;
6062
- return this . module . unreachable ( ) ;
6063
- }
6064
- return expr ;
6065
6065
}
6066
6066
6067
6067
/**
@@ -6079,7 +6079,7 @@ export class Compiler extends DiagnosticEmitter {
6079
6079
var thisType = signature . thisType ;
6080
6080
if ( hasThis != ( thisType != null ) ) {
6081
6081
this . error (
6082
- DiagnosticCode . Operation_not_supported , // TODO: better message?
6082
+ DiagnosticCode . The_this_types_of_each_signature_are_incompatible ,
6083
6083
reportNode . range
6084
6084
) ;
6085
6085
return false ;
@@ -6089,7 +6089,7 @@ export class Compiler extends DiagnosticEmitter {
6089
6089
var hasRest = signature . hasRest ;
6090
6090
if ( hasRest ) {
6091
6091
this . error (
6092
- DiagnosticCode . Operation_not_supported ,
6092
+ DiagnosticCode . Not_implemented ,
6093
6093
reportNode . range
6094
6094
) ;
6095
6095
return false ;
@@ -6126,7 +6126,7 @@ export class Compiler extends DiagnosticEmitter {
6126
6126
// Library files may always use unsafe features
6127
6127
if ( this . options . noUnsafe && ! reportNode . range . source . isLibrary ) {
6128
6128
this . error (
6129
- DiagnosticCode . Expression_is_unsafe ,
6129
+ DiagnosticCode . Operation_is_unsafe ,
6130
6130
reportNode . range
6131
6131
) ;
6132
6132
}
@@ -7312,7 +7312,7 @@ export class Compiler extends DiagnosticEmitter {
7312
7312
}
7313
7313
}
7314
7314
this . error (
7315
- DiagnosticCode . Operation_not_supported ,
7315
+ DiagnosticCode . Not_implemented ,
7316
7316
expression . range
7317
7317
) ;
7318
7318
return this . module . unreachable ( ) ;
@@ -7390,8 +7390,8 @@ export class Compiler extends DiagnosticEmitter {
7390
7390
) ;
7391
7391
} else {
7392
7392
this . error (
7393
- DiagnosticCode . Operation_not_supported ,
7394
- expression . range
7393
+ DiagnosticCode . Operator_0_cannot_be_applied_to_types_1_and_2 ,
7394
+ expression . range , "instanceof" , actualType . toString ( ) , expectedType . toString ( )
7395
7395
) ;
7396
7396
}
7397
7397
}
@@ -7432,8 +7432,8 @@ export class Compiler extends DiagnosticEmitter {
7432
7432
) ;
7433
7433
} else {
7434
7434
this . error (
7435
- DiagnosticCode . Operation_not_supported ,
7436
- expression . range
7435
+ DiagnosticCode . Operator_0_cannot_be_applied_to_types_1_and_2 ,
7436
+ expression . range , "instanceof" , actualType . toString ( ) , expectedType . toString ( )
7437
7437
) ;
7438
7438
}
7439
7439
}
@@ -7468,8 +7468,8 @@ export class Compiler extends DiagnosticEmitter {
7468
7468
}
7469
7469
}
7470
7470
this . error (
7471
- DiagnosticCode . Operation_not_supported ,
7472
- expression . range
7471
+ DiagnosticCode . The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly ,
7472
+ expression . range , "T"
7473
7473
) ;
7474
7474
return module . unreachable ( ) ;
7475
7475
}
@@ -7515,7 +7515,7 @@ export class Compiler extends DiagnosticEmitter {
7515
7515
// case LiteralKind.REGEXP:
7516
7516
}
7517
7517
this . error (
7518
- DiagnosticCode . Operation_not_supported ,
7518
+ DiagnosticCode . Not_implemented ,
7519
7519
expression . range
7520
7520
) ;
7521
7521
this . currentType = contextualType ;
@@ -7777,7 +7777,7 @@ export class Compiler extends DiagnosticEmitter {
7777
7777
if ( ! target ) return module . unreachable ( ) ;
7778
7778
if ( target . kind != ElementKind . CLASS_PROTOTYPE ) {
7779
7779
this . error (
7780
- DiagnosticCode . Cannot_use_new_with_an_expression_whose_type_lacks_a_construct_signature ,
7780
+ DiagnosticCode . This_expression_is_not_constructable ,
7781
7781
expression . expression . range
7782
7782
) ;
7783
7783
return this . module . unreachable ( ) ;
@@ -8038,7 +8038,7 @@ export class Compiler extends DiagnosticEmitter {
8038
8038
}
8039
8039
}
8040
8040
this . error (
8041
- DiagnosticCode . Operation_not_supported ,
8041
+ DiagnosticCode . Not_implemented ,
8042
8042
expression . range
8043
8043
) ;
8044
8044
return module . unreachable ( ) ;
@@ -8190,8 +8190,8 @@ export class Compiler extends DiagnosticEmitter {
8190
8190
}
8191
8191
}
8192
8192
this . error (
8193
- DiagnosticCode . Operation_not_supported ,
8194
- expression . range
8193
+ DiagnosticCode . The_0_operator_cannot_be_applied_to_type_1 ,
8194
+ expression . range , "++" , this . currentType . toString ( )
8195
8195
) ;
8196
8196
if ( tempLocal ) flow . freeTempLocal ( tempLocal ) ;
8197
8197
return module . unreachable ( ) ;
@@ -8279,8 +8279,8 @@ export class Compiler extends DiagnosticEmitter {
8279
8279
}
8280
8280
}
8281
8281
this . error (
8282
- DiagnosticCode . Operation_not_supported ,
8283
- expression . range
8282
+ DiagnosticCode . The_0_operator_cannot_be_applied_to_type_1 ,
8283
+ expression . range , "--" , this . currentType . toString ( )
8284
8284
) ;
8285
8285
if ( tempLocal ) flow . freeTempLocal ( tempLocal ) ;
8286
8286
return module . unreachable ( ) ;
0 commit comments