Rebuilding SwiftBase from GitHub

Is there any documentation on how to rebuild the SwiftBase library from GitHub? I have reported a couple of issues that I know are resolved on GitHub but there hasn’t been a new release of Elements made available as yet. The issue I am referring to is prefix() and suffix() not being public which has halted the project I am working on.

  1. Open Swift.sln
  2. Hit “Build”
  3. There is no step three


I’ve recompiled the library and copied the new swift.dll over the old versions but I still get the error

Message: suffix() is not implemented yet.

What else is needed?


you will need to reference your version explictiuyl form your project. What IDE and OS are you using, and what’s your target platform?

I’m using Windows 10 to compile and that is the target platform. I normally use Visual Studio 2019 but I’m happy (and have tried) using Water - I just need to familiarise myself with that.


ok. I assume thats native Windows (not .NET).

What you want todo is find the generated Siwft.fx file that was created when you rebuid; it should be under the “Bin” folder; in Water you can also right-click the Swift base library project and chose “Show Output in Explorer” to find it.

You will want to add a reference to that copy of the .fx to your actual project.

In Water, simply drag the Swift.fx file form Explorer onto the References node in your projeds. Water will update the existing reference with a hardcoded path to your version (you will see “(…)” as a hint for that, after the name, and selecting the Swift reference in the tree will also show the hopefully correct path in the main view

In Visual Studio, I believe you have to manually remove the existing Swift reference form your project, and then add a new one using the “Browse” button In the Add References dialog.


ps: if you’re using .NET after all, just substitute “.dll” everywhere where i said “.fx”, above.

I’ve tried to get this to work but I still get the error about prefix() and suffix() not being implemented after dragging and dropping swift.dll into the project as described. When will the next release of the non-beta code be made that will include this fix? Thanks

Curious,. are the functions marked as public in the version you build? in the build log, do you see the path to your version of the Swift.dll being used?

This is in current builds, but I cannot say when we’ll have the next Stable channel build. could be next week, but I dont wanna make promises.

Ran the program again and paid a little more attention and when run with this code

patch_level = String(patch_level.suffix(4))

I get this error

> !> Exception of type System.Exception on thread 271C
> !> Message: suffix() is not implemented yet., file /Users/xxxxxx/Downloads/Swift/SwiftBaseLibrary-master/Source/Sequence_Extensions.swift, line 350

In Sequence_Extensions.swift at line 350 is

> 	public func suffix(_ maxLength: Int) -> ISequence<T> {
> 		fatalError("suffix() is not implemented yet.")
> 	}

Guessing this is the problem - any idea when this will be implemented?

hmm, let me see. what platform is this, .NET? patch_level is a string I take it?

There seems to be some kind of compiler bug.

For one, I can see only public func suffix(from: Index) declared, so that would have to be called as .suffix(from: 4), not .suffix(4). I’m not sure if that’s how it should be to not, because Apple renames these every three days, it seems — I’ll check.

THAT said, I can conform that I can’t call the, not sure why — that part looks like a compiler bug.


Thanks, logged as bugs://84684

As workaround, patch_level = patch_level.Substring(4) works ok.

Yes, a string

What platform? because this doesn’t compiler at all for me, for .NET. can I see your (or a) full project, by any chance? thanx!