Silver doesn't like "A Swift Tour"


(Isral) #1

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=, 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

(RemObjects) #2

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

(Carlo Kok) #3

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

(Carlo Kok) #4

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

(Isral) #5

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).

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.

(Isral) #6

No error on Island on 2349.

.net version still error.

(Carlo Kok) #7

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

(marc hoffman) #8

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

(Isral) #9

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)

(Carlo Kok) #10

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

(Isral) #11

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`

(Carlo Kok) #12

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.

(RemObjects) #13

bugs://81526 got closed with status fixed.

(RemObjects) #14

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()

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()

(Isral) #15

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>()

and cause error:

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

Is it expected?

(Carlo Kok) #16

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.

(Carlo Kok) #17

the Java issue is fixed for the next build.

(RemObjects) #18

bugs://81525 got closed with status fixed.

(Isral) #19

VS2017 silver .net windows form (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.


  • 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

(RemObjects) #20

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