I tried to make a tree with swift using fonctionnal way
here is my code:
//this code works
struct testArbre {
var racine: Int?
}
let a0 = testArbre(racine:nil)
//this code stuck on error
struct arbre {
var racine: Int?
var feuilleGauche: arbre?
var feuilleDroite : arbre?
}
let a1 = arbre(racine: 10, feuilleGauche: nil, feuilleDroite: nil)
let a2 = arbre(racine:5, feuilleGauche:nil, feuilleDroite:nil)
let a3 = arbre(racine:1, feuilleGauche: a1, feuilleDroite: a2);
and here is the error when running this code:
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
Command /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254