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

"method is not a base" on method with {.base.} #125

Open
Phytolizer opened this issue Dec 4, 2021 · 2 comments
Open

"method is not a base" on method with {.base.} #125

Phytolizer opened this issue Dec 4, 2021 · 2 comments

Comments

@Phytolizer
Copy link

I first raised this issue on nimlsp (PMunch/nimlsp#100) but was directed here.

The following snippet of code shows an error in nimlsp 0.3.2:

type
  UnimplementedDefect = object of Defect

  Node* = ref object of RootObj
  Statement* = ref object of Node
  Expression* = ref object of Node

  Program* = ref object of Node
    statements*: seq[Statement]

method tokenLiteral*(n: Node): string {.base.} =
  raise newException(UnimplementedDefect, "unimplemented: tokenLiteral")

method tokenLiteral*(p: Program): string =
  if p.statements.len > 0:
    return p.statements[0].tokenLiteral()
  else:
    return ""

It compiles just fine with Nim 1.7.1, but I get "method is not a base" within Emacs.

@bbbscarter
Copy link

Flagging that I'm also seeing this, with Nim >2.1.1 in Emacs, using nimsuggest directly (rather than via LSP). The application compiles without errors or warning, but nimsuggest complains.

@Seanld
Copy link

Seanld commented Apr 22, 2024

I'm also in Emacs (using LSP however), and I also get this message. Compilation succeeds silently for me too. Nim 2.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants