Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: unexpected cannot infer type of forward variable #4733

Open
crusso opened this issue Oct 15, 2024 · 0 comments
Open

BUG: unexpected cannot infer type of forward variable #4733

crusso opened this issue Oct 15, 2024 · 0 comments
Labels
Bug Something isn't working typing Involves the type system

Comments

@crusso
Copy link
Contributor

crusso commented Oct 15, 2024

import { debugPrint; principalOfActor } = "mo:⛔";

actor class C() = Self {
    debugPrint "So far so good!" 
}

produces

type error [M0055], cannot infer type of forward variable debugPrint

I think its happening because of the special treatment of the last declaration in a block, that determines its return type.

But it's odd that we don't consider the type of imported identifiers to be known (they should be I think).

@crusso crusso added Bug Something isn't working typing Involves the type system labels Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working typing Involves the type system
Projects
None yet
Development

No branches or pull requests

1 participant