Skip to content

Commit 0bfeb80

Browse files
committed
Add span when translating with to an and type
1 parent 38ba6e1 commit 0bfeb80

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ object Parsers {
15491549
else
15501550
if sourceVersion.isAtLeast(`3.1`) then
15511551
deprecationWarning(DeprecatedWithOperator(), withOffset)
1552-
makeAndType(t, withType())
1552+
atSpan(in.lastOffset, withOffset) { makeAndType(t, withType()) }
15531553
else t
15541554

15551555
/** AnnotType ::= SimpleType {Annotation}

tests/neg-scalajs/js-native-members.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,8 @@ object A5 {
9393
var apply: Int = js.native // ok
9494
}
9595
}
96+
97+
@js.native
98+
trait A6 extends js.Object {
99+
def assign[T, U](target: T, source: U): T with U = js.native
100+
}

0 commit comments

Comments
 (0)