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

Tweak AvoidMap's derivedSelect #16563

Merged
merged 1 commit into from
Jan 3, 2023
Merged

Tweak AvoidMap's derivedSelect #16563

merged 1 commit into from
Jan 3, 2023

Conversation

dwijnand
Copy link
Member

@dwijnand dwijnand commented Dec 20, 2022

Using the example from pos/i16435.avoid:

class Foo:
  type Value
  def test: Option[Value] =
    val scr = {
      val self: Foo.this.type = this
      None: Option[self.Value]
    }
    scr

We want avoidance to return Option[Value], aka
Option[Foo.this.Value], rather than widening to Option[Any].

Using test cases i16105,i16435,i2945,i8900,i8861 we don't tryWiden if
the derived prefix is a singleton.

And fix some kind of race condition in creating files/directories.

@dwijnand dwijnand changed the title Delay widening in derivedSelect when avoiding Tweak AvoidMap's derivedSelect Dec 21, 2022
Using the example from `pos/i16435.avoid`:

    class Foo:
      type Value
      def test: Option[Value] =
        val scr = {
          val self: Foo.this.type = this
          None: Option[self.Value]
        }
        scr

We want avoidance to return `Option[Value]`, aka
`Option[Foo.this.Value]`, rather than widening to `Option[Any]`.

Using test cases i16105,i16435,i2945,i8900,i8861 we don't tryWiden if
the derived prefix is a singleton.

And fix some kind of race condition in creating files/directories.
@smarter smarter merged commit bcf44f8 into scala:main Jan 3, 2023
@dwijnand dwijnand deleted the exh/inline branch January 3, 2023 17:16
@Kordyjan Kordyjan added this to the 3.3.0 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants