Skip to content

[move] Function-level imports not able to use top-level module imports #25353

@admin-aftermath

Description

@admin-aftermath

Overview

Function-level imports are unable to use top-level package imports. I have created this package showcasing this issue.

Here is the relevant code.

module module_aliases::module_aliases;

use sui::package;

public struct MODULE_ALIASES() has drop;

fun init(otw: MODULE_ALIASES, ctx: &mut TxContext) {
    use package::claim_and_keep;

    claim_and_keep(otw, ctx);
}

In this example, you would expect the init function to be able to import the claim_and_keep function using the top-level sui::package import of the package module. The code, however, does not compile.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions