Skip to content

"A 'declare' modifier cannot be used in an already ambient context" after upgrading to version 0.27.35 #2915

Closed
@haykam821

Description

@haykam821

Bug description

When upgrading to version 0.27.35, I am getting a new error in my builds:

> tsc

../../node_modules/assemblyscript/std/assembly/index.d.ts:2698:3 - error TS1038: A 'declare' modifier cannot be used in an already ambient context.

2698   declare function always<T>(value: T): T;
       ~~~~~~~


Found 1 error in ../../node_modules/assemblyscript/std/assembly/index.d.ts:2698

The changelog for the release does not indicate any particular change that would cause this breakage. The corresponding lines of code appear to be:

export namespace inline {
// @ts-ignore: decorator
@unsafe @builtin
export declare function always<T>(expr: T): T;
}

Steps to reproduce

The particular package that fails to build uses the following TypeScript configuration with tsc:

{
	"compilerOptions": {
		"outDir": "./dist",
		"rootDir": "./src"
	},
	"extends": "assemblyscript/std/assembly.json",
	"include": [
		"./src"
	]
}

AssemblyScript version

v0.27.35

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions