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

@native method treated as abstract in subclass #20588

Closed
liontiger23 opened this issue Jun 17, 2024 · 0 comments · Fixed by #21593
Closed

@native method treated as abstract in subclass #20588

liontiger23 opened this issue Jun 17, 2024 · 0 comments · Fixed by #21593

Comments

@liontiger23
Copy link

Compiler version

Scala compiler version 3.3.1 -- Copyright 2002-2023, LAMP/EPFL

Minimized code

Requires two source files:

$ cat Foo.scala
class Foo {
  @native def test(): Unit
}
class Bar extends Foo

$ cat Baz.scala
class Baz extends Foo

Output

$ scalac Foo.scala
$ scalac Baz.scala
-- Error: Baz.scala:1:6 -----------------------------------------------------------------------------------------------------------------------------------------------------
1 |class Baz extends Foo
  |      ^
  |      class Baz needs to be abstract, since def test(): Unit in class Foo is not defined
1 error found

Expectation

No errors, when subclass and superclass are compiled in separate sessions.

Note: if subclass is located in the same file (or in the same compilation session), like with Bar in Foo.scala, then it compiles without errors

@liontiger23 liontiger23 added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 17, 2024
@Gedochao Gedochao added area:typer and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 25, 2024
@WojciechMazur WojciechMazur added this to the 3.6.0 milestone Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants