temperlang / temper

3 stars 0 forks source link

Bad ListBuilder `set` method translation for C# #82

Closed tjpalmer closed 8 months ago

tjpalmer commented 9 months ago

Temper code like do { let a = new ListBuilder<Int>(); a.add(5); a[0] = 2 * a[0] } translates to C# like this:

                      a__0 = new G::List<int>();
                      C::Listed.Add(a__0, 5);
                      t___10 = a__0[0];
                      a__0.Set(0, 2 * t___10);

Except that the Set method isn't a thing:

error CS1061: 'IList' does not contain a definition for 'Set' and no accessible extension method 'Set' accepting a first argument of type 'IList' could be found

We apparently don't check this in funtests. We probably should add that.

tjpalmer commented 9 months ago

See also #84.