Skip to content

Commit

Permalink
Enable noImplicitOverride
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x committed Nov 1, 2023
1 parent 3322c53 commit 21ae8fd
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 33 deletions.
24 changes: 12 additions & 12 deletions src/common/internal/query/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export class TestQueryMultiFile {
* Immutable (makes copies of constructor args).
*/
export class TestQueryMultiTest extends TestQueryMultiFile {
readonly level: TestQueryLevel = 2;
readonly isMultiFile = false as const;
override readonly level: TestQueryLevel = 2;
override readonly isMultiFile = false as const;
readonly isMultiTest: boolean = true;
readonly testPathParts: readonly string[];

Expand All @@ -79,11 +79,11 @@ export class TestQueryMultiTest extends TestQueryMultiFile {
this.testPathParts = [...test];
}

get depthInLevel() {
override get depthInLevel() {
return this.testPathParts.length;
}

protected toStringHelper(): string[] {
protected override toStringHelper(): string[] {
return [
this.suite,
this.filePathParts.join(kPathSeparator),
Expand All @@ -99,8 +99,8 @@ export class TestQueryMultiTest extends TestQueryMultiFile {
* (which aren't normally supposed to change; they're marked readonly in TestParams).
*/
export class TestQueryMultiCase extends TestQueryMultiTest {
readonly level: TestQueryLevel = 3;
readonly isMultiTest = false as const;
override readonly level: TestQueryLevel = 3;
override readonly isMultiTest = false as const;
readonly isMultiCase: boolean = true;
readonly params: TestParams;

Expand All @@ -110,11 +110,11 @@ export class TestQueryMultiCase extends TestQueryMultiTest {
this.params = { ...params };
}

get depthInLevel() {
override get depthInLevel() {
return Object.keys(this.params).length;
}

protected toStringHelper(): string[] {
protected override toStringHelper(): string[] {
return [
this.suite,
this.filePathParts.join(kPathSeparator),
Expand All @@ -130,14 +130,14 @@ export class TestQueryMultiCase extends TestQueryMultiTest {
* Immutable (makes copies of constructor args).
*/
export class TestQuerySingleCase extends TestQueryMultiCase {
readonly level: TestQueryLevel = 4;
readonly isMultiCase = false as const;
override readonly level: TestQueryLevel = 4;
override readonly isMultiCase = false as const;

get depthInLevel() {
override get depthInLevel() {
return 0;
}

protected toStringHelper(): string[] {
protected override toStringHelper(): string[] {
return [
this.suite,
this.filePathParts.join(kPathSeparator),
Expand Down
2 changes: 1 addition & 1 deletion src/common/util/preprocessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class If extends Directive {
}

class ElseIf extends If {
applyTo(stack: StateStack) {
override applyTo(stack: StateStack) {
assert(stack.length >= 1);
const { allowsFollowingElse, state: siblingState } = stack.pop()!;
this.checkDepth(stack);
Expand Down
4 changes: 2 additions & 2 deletions src/unittests/async_expectations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { TestGroupTest } from './test_group_test.js';
import { UnitTest } from './unit_test.js';

class FixtureToTest extends UnitTest {
public immediateAsyncExpectation<T>(fn: () => Promise<T>): Promise<T> {
public override immediateAsyncExpectation<T>(fn: () => Promise<T>): Promise<T> {
return super.immediateAsyncExpectation(fn);
}
public eventualAsyncExpectation<T>(fn: (niceStack: Error) => Promise<T>): void {
public override eventualAsyncExpectation<T>(fn: (niceStack: Error) => Promise<T>): void {
super.eventualAsyncExpectation(fn);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ const fullscreenQuadWGSL = `
class TextureSyncTestHelper extends OperationContextHelper {
private texture: GPUTexture;

public readonly kTextureSize = [4, 4] as const;
public readonly kTextureFormat: EncodableTextureFormat = 'rgba8unorm';
public override readonly kTextureSize = [4, 4] as const;
public override readonly kTextureFormat: EncodableTextureFormat = 'rgba8unorm';

constructor(
t: GPUTest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class F extends TextureTestMixin(GPUTest) {
private sampleTexture: GPUTexture | undefined;
private sampler: GPUSampler | undefined;

async init() {
override async init() {
await super.init();
if (this.isCompatibility) {
this.skip('WGSL sample_mask is not supported in compatibility mode');
Expand Down
2 changes: 1 addition & 1 deletion src/webgpu/api/operation/sampling/anisotropy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class SamplerAnisotropicFilteringSlantedPlaneTest extends GPUTest {
}

private pipeline: GPURenderPipeline | undefined;
async init(): Promise<void> {
override async init(): Promise<void> {
await super.init();

this.pipeline = this.device.createRenderPipeline({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export class LimitTestsImpl extends GPUTestBase {
defaultLimit = 0;
adapterLimit = 0;

async init() {
override async init() {
await super.init();
const gpu = getGPU(this.rec);
this._adapter = await gpu.requestAdapter();
Expand All @@ -318,7 +318,7 @@ export class LimitTestsImpl extends GPUTestBase {
return this._adapter!;
}

get device(): GPUDevice {
override get device(): GPUDevice {
assert(this._device !== undefined, 'device is only valid in _testThenDestroyDevice callback');
return this._device;
}
Expand Down Expand Up @@ -584,7 +584,11 @@ export class LimitTestsImpl extends GPUTestBase {
/**
* Calls a function that expects a validation error if shouldError is true
*/
async expectValidationError<R>(fn: () => R, shouldError: boolean = true, msg = ''): Promise<R> {
override async expectValidationError<R>(
fn: () => R,
shouldError: boolean = true,
msg = ''
): Promise<R> {
return this.expectGPUErrorAsync('validation', fn, shouldError, msg);
}

Expand Down Expand Up @@ -1067,7 +1071,7 @@ export class LimitTestsImpl extends GPUTestBase {
*/
function makeLimitTestFixture(limit: GPUSupportedLimit): typeof LimitTestsImpl {
class LimitTests extends LimitTestsImpl {
limit = limit;
override limit = limit;
}

return LimitTests;
Expand Down
2 changes: 1 addition & 1 deletion src/webgpu/api/validation/error_scope.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ErrorScopeTests extends Fixture {
return this._device;
}

async init(): Promise<void> {
override async init(): Promise<void> {
await super.init();
const gpu = getGPU(this.rec);
const adapter = await gpu.requestAdapter();
Expand Down
2 changes: 1 addition & 1 deletion src/webgpu/compat/compatibility_test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ValidationTest } from '../api/validation/validation_test.js';

export class CompatibilityTest extends ValidationTest {
async init() {
override async init() {
await super.init();
if (!this.isCompatibility) {
this.skip('compatibility tests do not work on non-compatibility mode');
Expand Down
10 changes: 5 additions & 5 deletions src/webgpu/gpu_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ export class GPUTestSubcaseBatchState extends SubcaseBatchState {
/** Provider for mismatched device. */
private mismatchedProvider: Promise<DeviceProvider> | undefined;

async postInit(): Promise<void> {
override async postInit(): Promise<void> {
// Skip all subcases if there's no device.
await this.acquireProvider();
}

async finalize(): Promise<void> {
override async finalize(): Promise<void> {
await super.finalize();

// Ensure devicePool.release is called for both providers even if one rejects.
Expand Down Expand Up @@ -254,7 +254,7 @@ export class GPUTestSubcaseBatchState extends SubcaseBatchState {
* as well as helpers that use that device.
*/
export class GPUTestBase extends Fixture<GPUTestSubcaseBatchState> {
public static MakeSharedState(
public static override MakeSharedState(
recorder: TestCaseRecorder,
params: TestParams
): GPUTestSubcaseBatchState {
Expand Down Expand Up @@ -1074,7 +1074,7 @@ export class GPUTest extends GPUTestBase {
private provider: DeviceProvider | undefined;
private mismatchedProvider: DeviceProvider | undefined;

async init() {
override async init() {
await super.init();

this.provider = await this.sharedState.acquireProvider();
Expand All @@ -1084,7 +1084,7 @@ export class GPUTest extends GPUTestBase {
/**
* GPUDevice for the test to use.
*/
get device(): GPUDevice {
override get device(): GPUDevice {
assert(this.provider !== undefined, 'internal error: GPUDevice missing?');
return this.provider.device;
}
Expand Down
2 changes: 1 addition & 1 deletion src/webgpu/idl/idl_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface UnknownObject {
* Base fixture for testing the exposed interface is correct (without actually using WebGPU).
*/
export class IDLTest extends Fixture {
init(): Promise<void> {
override init(): Promise<void> {
// Ensure the GPU provider is initialized
getGPU(this.rec);
return Promise.resolve();
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@
"strict": true,
/* tsc lint options */
"allowUnusedLabels": false,
"noImplicitOverride": true,
"noImplicitReturns": true,
/* These should be caught by eslint instead */
"noFallthroughCasesInSwitch": false,
"noUnusedLocals": false,
"noUnusedParameters": false,
"allowUnreachableCode": true,
/* Compiler warnings we intentionally don't use */
// - Would be nice, but we need to upgrade eslint first for new syntax
"noImplicitOverride": false,
// - Would be nice, but produces lots of errors that probably aren't worth fixing
"noUncheckedIndexedAccess": false,
// - We could make our code pass this, but it doesn't seem to provide much value to us
Expand Down

0 comments on commit 21ae8fd

Please sign in to comment.