Silver doesn't like "A Swift Tour"

I try A Swift Tour but Silver doesn’t like it.
This file taken from there: Contents.swift.txt (4.2 KB)
“let widthLabel = label + String(width)” is the problematic line.

On .net windows console: System.IO.FileLoadException: 'Could not load file or assembly ‘Echoes, Version=9.3.103.2211, Culture=neutral, PublicKeyToken=3df3cad1b7aa5098’ or one of its dependencies.

On island windows console: (E506) Variable “label” must be initialized before it can be used.

I use VS2017 with elements 10.0.0.2347.

Thanks, logged as bugs://81513 for the Invalid cast at runtime

Can you tell me how you did that? The default console application template has Echoes and Swift as copy-local references.

I’ve not been able to reproduce the Island windows console part with 2349, compiles and runs.

I use 2347, maybe mine too old?
I use .net 4.6.2.
New project silver .net windows console.
Replace program.swift contents with the file that uploaded, click start (button with green triangle).
Untitled

For Island, the steps are same.
(E506) Variable “label” must be initialized before it can be used
(E506) Variable “width” must be initialized before it can be used

BTW island compilation time is noticeable longer, is this expected?

I’ll back after update to 2349.

No error on Island on 2349.

.net version still error.

Thanks; my colleague just reproduced it. It’s logged and caused by a version mismatch of Echoes and Swift.

Also, that seems to be a very old version of Echoes.dll (9.3.103.2211), not matching the rest (10.0.0.2347). Can you check your system for old copies of Echoes.dll and maybe delete them?

More errors on java, .net. island:
Enumerations and Structures.swift.txt (4.9 KB)
Error Handling.swift.txt (2.9 KB)
Functions and Closures.swift.txt (3.8 KB)
Generics.swift.txt (1.5 KB)

Those sound like bugs. My colleague will log these and fix these and we’ll hopefully fix most if not all soon.

In .net, java, and island console, a single line program.swift:

let label = "The width is "

create this error:

(E103) Could not find a "Main" method in this project`

That’s pretty much as designed. Our compiler expects a body for it to be able to do something, an empty block which doesn’t do anything can’t be ran.

bugs://81526 got closed with status fixed.

bugs://81527 got closed with status fixed.

Except for Java:

func makeIncrementer() -> ((Int) -> Int) {
    func addOne(number: Int) -> Int {
        return 1 + number
    }
    return addOne
}
var increment = makeIncrementer()
increment(7)

due to the limitations of generics on Java, value types have to be nullable on both ends for this to compile:

func makeIncrementer() -> ((Int?) -> Int?) {
func addOne(number: Int?) -> Int? {
return 1 + number
}
return addOne
}
var increment = makeIncrementer()
increment(7)

How do I now it’s a generic?
I mean if it’s a generic, it would be:

func makeIncrementer<T>() -> ((T) -> T)

BTW I just try this on .net:

func makeIncrementer<T>() -> ((T) -> T) {
    func addOne(number: T) -> T {
        return number
    }
    return addOne
}
var increment = makeIncrementer<Int>()
increment(7)

and cause error:

(E0) Internal error: System.NullReferenceException: Object reference not set to an instance of an object.

Is it expected?

I just fixed that. (should be fixed in the next build)

the generics issue is related to the function pointers. (A) -> (B) points to the Func1…Func7 types we have in Cooper.jar (or Action when something doesn’t return a type).

So (int) -> (int) becomes Func2<Int, Int>, problem is that Java doesn’t really allow that,it only allows reference types so the compiler turns them into nullable Integers. anyway I’m looking for a solution for that one.

the Java issue is fixed for the next build.

bugs://81525 got closed with status fixed.

VS2017 silver .net windows form
WindowsApplication2.zip (63.8 KB)


Code completion not available on designer.


Manually editing designer can cause unrecoverable error.
Reverting to manually back up code doesn’t help.
Untitled2


Step:

  • New project > Silver > .Net > Windows > WinForms
  • Dock TableLayoutPanel to Form
  • Dock Button to TableLayoutPanel
  • Copy designer contents to other text editor for back up.
  • Remove “Fill” from “self.button1.Dock = System.Windows.Forms.DockStyle.Fill”
  • Notice code completion for “.Fill” not available.
  • F6
  • Restore from back up
  • Notice Error occured on design view (gui, not code).
  • Close VS2017
  • Reopen .sln
  • Notice Error persist

Thanks, logged as bugs://81533, for the form designer