@@ -428,7 +428,7 @@ export class Compiler extends DiagnosticEmitter {
428
428
if ( cyclicClasses . size ) {
429
429
if ( options . pedantic ) {
430
430
for ( let classInstance of cyclicClasses ) {
431
- this . info (
431
+ this . pedantic (
432
432
DiagnosticCode . Type_0_is_cyclic_Module_will_include_deferred_garbage_collection ,
433
433
classInstance . identifierNode . range , classInstance . internalName
434
434
) ;
@@ -504,7 +504,7 @@ export class Compiler extends DiagnosticEmitter {
504
504
if ( options . importTable ) {
505
505
module . addTableImport ( "0" , "env" , "table" ) ;
506
506
if ( options . pedantic && options . willOptimize ) {
507
- this . warning (
507
+ this . pedantic (
508
508
DiagnosticCode . Importing_the_table_disables_some_indirect_call_optimizations ,
509
509
null
510
510
) ;
@@ -513,7 +513,7 @@ export class Compiler extends DiagnosticEmitter {
513
513
if ( options . exportTable ) {
514
514
module . addTableExport ( "0" , ExportNames . table ) ;
515
515
if ( options . pedantic && options . willOptimize ) {
516
- this . warning (
516
+ this . pedantic (
517
517
DiagnosticCode . Exporting_the_table_disables_some_indirect_call_optimizations ,
518
518
null
519
519
) ;
@@ -5578,6 +5578,12 @@ export class Compiler extends DiagnosticEmitter {
5578
5578
assert ( indexedSet . signature . parameterTypes . length == 2 ) ; // parser must guarantee this
5579
5579
targetType = indexedSet . signature . parameterTypes [ 1 ] ; // 2nd parameter is the element
5580
5580
if ( indexedSet . hasDecorator ( DecoratorFlags . UNSAFE ) ) this . checkUnsafe ( expression ) ;
5581
+ if ( ! isUnchecked && this . options . pedantic ) {
5582
+ this . pedantic (
5583
+ DiagnosticCode . Indexed_access_may_involve_bounds_checking ,
5584
+ expression . range
5585
+ ) ;
5586
+ }
5581
5587
break ;
5582
5588
}
5583
5589
default : {
@@ -7220,11 +7226,18 @@ export class Compiler extends DiagnosticEmitter {
7220
7226
if ( targetType . is ( TypeFlags . REFERENCE ) ) {
7221
7227
let classReference = targetType . classReference ;
7222
7228
if ( classReference ) {
7223
- let indexedGet = classReference . lookupOverload ( OperatorKind . INDEXED_GET , this . currentFlow . is ( FlowFlags . UNCHECKED_CONTEXT ) ) ;
7229
+ let isUnchecked = this . currentFlow . is ( FlowFlags . UNCHECKED_CONTEXT ) ;
7230
+ let indexedGet = classReference . lookupOverload ( OperatorKind . INDEXED_GET , isUnchecked ) ;
7224
7231
if ( indexedGet ) {
7225
7232
let thisArg = this . compileExpression ( targetExpression , classReference . type ,
7226
7233
Constraints . CONV_IMPLICIT
7227
7234
) ;
7235
+ if ( ! isUnchecked && this . options . pedantic ) {
7236
+ this . pedantic (
7237
+ DiagnosticCode . Indexed_access_may_involve_bounds_checking ,
7238
+ expression . range
7239
+ ) ;
7240
+ }
7228
7241
return this . compileCallDirect ( indexedGet , [
7229
7242
expression . elementExpression
7230
7243
] , expression , thisArg , constraints ) ;
@@ -7671,6 +7684,12 @@ export class Compiler extends DiagnosticEmitter {
7671
7684
] , expression )
7672
7685
) ;
7673
7686
flow . freeTempLocal ( temp ) ;
7687
+ if ( this . options . pedantic ) {
7688
+ this . pedantic (
7689
+ DiagnosticCode . Expression_compiles_to_a_dynamic_check_at_runtime ,
7690
+ expression . range
7691
+ ) ;
7692
+ }
7674
7693
return ret ;
7675
7694
} else {
7676
7695
this . error (
0 commit comments