Scala Programming Language
  1. Scala Programming Language
  2. SI-7329

double definition error due to specialized constructor argument with default value

    Details

      Description

      compiling

      class TwoParamSpecializedWithDefault[@specialized A, @specialized B](a: A, b: B = (??? : B))
      

      yields

      error: double definition:
      method <init>$default$2$mVc$sp:()Unit and
      method <init>$default$2$mVc$sp:()Unit at line 1
      have same type
      

        Activity

        Hide
        Eugene Vigdorchik added a comment -

        Looking at this example makes me wonder if it ever makes sense to have default getter for a constructor parameter specialized. The fact that default getter is run before the instance is created strengthens this thought.

        Show
        Eugene Vigdorchik added a comment - Looking at this example makes me wonder if it ever makes sense to have default getter for a constructor parameter specialized. The fact that default getter is run before the instance is created strengthens this thought.

          People

          • Assignee:
            Eugene Vigdorchik
            Reporter:
            Adriaan Moors
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development