This was brought over from the Java runtime in the initial port, but there
it was used as an array capacity hint. We're not using it in Swift so
this is useless.
This is a subclass that only exists to have a different constructor. There
is no need for this construction in Swift, since we have named parameters,
so we can remove the entire subclass and make ATNConfigSet final instead.
Add -f netstandard1.3 to the dotnet build command used on Travis.
This has been necessary since PR #2024, and the build has been silently failing
all this time.
Change all the subprocess calls in boot.py to check whether they succeeded,
and set the script status appropriately.
In particular, when our unit tests fail, we need the script to exit
with a failure code so that we actually notice on Travis.
Change the unit test asserts so that we can see all the values in the
event of a failure. When debugging an error, it's useful to see both
the stdout and stderr for the failure. Previously we would only see
one or the other (whichever one failed the assert).
This adds a helper function BaseRuntimeTest.assertCorrectOutput.
This also removes SpecialRuntimeTestAssert, which has not been used for
2 years.
This means that if you build in an unclean source tree, you don't end up with
intermediate classes in the jar. (This hasn't broken anything that I noticed,
but it bloats the jar and I wanted to make sure it wasn't messing anything up.)
This excludes .build (the Swift runtime's build directory), target (the Java
runtime's build directory) and Swift/*.xcodeproj (which is not in the source tree
but can be created by devs who are using Xcode).
This was always clearly a possibility, looking at the body of the method.
The newly-enabled performance tests expose this bug (and I don't know how
we've gotten away with it otherwise for so long).
The Java runtime also returns null at this point.
The ATNState hashValue and == override are just using the stateNumber field, so
using the Int directly is equivalent, and saves bouncing through those methods.
This also seems to be a correctness issue with the new Hashable protocol changes in
Swift 4.2 (though I admit that I don't know why).
Remove PredictionMode.getStateToAltMap, which was just a stub onto
ATNConfigSet.getStateToAltMap and didn't seem to be doing anything useful.
Avoid adding to closureBusy before all ATNConfig properties are set.
This fixes#2372.
This is a port of c8805ab from the Java runtime. That was PR #1955.
Suppress "Optional" in the output when printing a value in the tests and
some debugging messages.
This is a change in behavior in Swift 4.2 (SE-0054) that implicitly
unwrapped optionals are now seen as plain Optional at runtime, and so
print doesn't implicitly unwrap them any more.
This was working before because calling hashValue on a boxed UInt32 gave
back the value itself. This is apparently no longer true.
It's not something we should have been doing anyway. We were needlessly
boxing the intermediate hash values, and passing them into a generic
method, just to unbox them again.
Fix this by creating a helper method, and calling that directly when
updating intermediate hash values.
This is three instances of flatMap changing to compactMap, and
one instance of UnsafeMutablePointer.deallocate(capacity:) changing
to UnsafeMutablePointer.deallocate().
Move Travis Swift, .NET, and C++ macOS tests from Xcode 9 to Xcode 10.1.
Move Travis Linux Swift tests from Trusty to Xenial and to Swift 4.2.1.
Remove the dirname call when setting JAVA_HOME, it seems to be incorrect.
Print the JAVA_HOME that Travis ends up with.
Moving to Xcode 10.1 / Swift 4.2 exposes the issue discussed in #2372
so this cset will fail automated tests without the relevant fixes.
This is in different locations on JDK 9 and up. maven-jdk-tools-wrapper
does the right thing on all JDK releases.
This was mentioned in a side comment on PR #2280.