Skip to content

Fix #9892: Add span when translating with to an and type #9953

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

Merged
merged 1 commit into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1549,7 +1549,7 @@ object Parsers {
else
if sourceVersion.isAtLeast(`3.1`) then
deprecationWarning(DeprecatedWithOperator(), withOffset)
makeAndType(t, withType())
atSpan(startOffset(t)) { makeAndType(t, withType()) }
else t

/** AnnotType ::= SimpleType {Annotation}
Expand Down
12 changes: 6 additions & 6 deletions tests/neg-scalajs/js-native-members.check
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@
57 | val bar = js.native // error
| ^^^^^^^^^^^^^^^^^^^
| The type of bar must be explicitly specified because it is JS native.
-- Error: tests/neg-scalajs/js-native-members.scala:65:8 ---------------------------------------------------------------
65 | def apply: Int = js.native // error
-- Error: tests/neg-scalajs/js-native-members.scala:66:8 ---------------------------------------------------------------
66 | def apply: Int = js.native // error
| ^
|A member named apply represents function application in JavaScript. A parameterless member should be exported as a property. You must add @JSName("apply")
-- Error: tests/neg-scalajs/js-native-members.scala:76:8 ---------------------------------------------------------------
76 | val apply: Int = js.native // error
-- Error: tests/neg-scalajs/js-native-members.scala:77:8 ---------------------------------------------------------------
77 | val apply: Int = js.native // error
| ^
|A member named apply represents function application in JavaScript. A parameterless member should be exported as a property. You must add @JSName("apply")
-- Error: tests/neg-scalajs/js-native-members.scala:87:8 ---------------------------------------------------------------
87 | var apply: Int = js.native // error
-- Error: tests/neg-scalajs/js-native-members.scala:88:8 ---------------------------------------------------------------
88 | var apply: Int = js.native // error
| ^
|A member named apply represents function application in JavaScript. A parameterless member should be exported as a property. You must add @JSName("apply")
1 change: 1 addition & 0 deletions tests/neg-scalajs/js-native-members.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ object A3 {
class A4 extends js.Object {
def foo = js.native // error
val bar = js.native // error
def assign[T, U](target: T, source: U): T with U = js.native // ok
}

// Members named `apply`
Expand Down