From 62d8ef175e9c04e8c31adc0ebe687964fe860bab Mon Sep 17 00:00:00 2001 From: Kacper Korban Date: Fri, 25 Oct 2024 10:48:56 +0200 Subject: [PATCH 1/3] fix: Allow `as` as an infix type in non context bound types --- compiler/src/dotty/tools/dotc/parsing/Parsers.scala | 2 +- tests/pos/i21769.scala | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/pos/i21769.scala diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index a4b3adbb7a00..7e256dec2f4b 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -4467,4 +4467,4 @@ object Parsers { (EmptyValDef, List(EmptyTree)) } } -} +} \ No newline at end of file diff --git a/tests/pos/i21769.scala b/tests/pos/i21769.scala new file mode 100644 index 000000000000..ad4194d4217d --- /dev/null +++ b/tests/pos/i21769.scala @@ -0,0 +1,10 @@ + +infix trait as[From, To] + +val conv: (String as Int) = ??? +given instance: (String as Int) = ??? +def test(ev: (String as Int)) = ??? + +class F + +class K extends (F as K) From efacf9b924c5faa88710dabdc56d549a6515d9ea Mon Sep 17 00:00:00 2001 From: Tomasz Godzik Date: Fri, 14 Feb 2025 17:54:37 +0100 Subject: [PATCH 2/3] fix: Allow `as` as an infix type in non context bound types [Cherry-picked e7221c672030375a0bd2391befc6e1fb4938693e][modified] From e46c78fcf3642322f0fe0667a1722f80fa8e82e9 Mon Sep 17 00:00:00 2001 From: Tomasz Godzik Date: Fri, 14 Feb 2025 17:55:36 +0100 Subject: [PATCH 3/3] Change inContextBound to a Boolean flag [Cherry-picked ae9cffa3a3c736103ca3bec2742b7fd7c2b930ac][modified]