skiptools / skiptools/skip

Error when exporting enum with an associated type with a default value

Open
#535 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug fuse transpilation
Dominant language
Swift
Stars
3.2k
Forks
106
Avg merge
6d 13h
Merged PRs (30d)
1

Description

The following code:

/// Defines the visual and interactive behavior of a button.
public enum ButtonStyle: Sendable {

  /// Simulates a 3D press with a shadow that changes depth on press.
  /// - Parameter shadowHeight: The height of the shadow.
  case press3D(shadowHeight: Double = 4)
}

Fails with the following error when trying to export:

➜  protocols-errors git:(main) ✗ skip export --project travel-posters-model -d Android/lib/debug/ --debug          
[✓] Check Swift Package (0.15s)
[✓] Getting SDK Path (0.0s)
[✓] Build project travel-posters-model (102.26s)
[✗] Assemble frameworks for TravelPostersModel (25.74s)
[✗] e: file:///Users/piercifani/Desktop/skip-errors/protocols-errors/travel-posters-model/.build/plugins/outputs/travel-posters-model/TravelPostersModel/destination/skipstone/TravelPostersModel/src/main/kotlin/travel/posters/model/ButtonStyle.kt:45:44 Initializer type mismatch: expected 'Double', actual 'Int'.
[✗] Skip 1.6.28 export failed with 2 errors
See https://skip.tools/docs/faq and https://community.skip.tools for help
See output log for error details: /tmp/skip-export-2025-11-09T17:27:33Z.txt
Error: 3 errors

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the shown skip export --project travel-posters-model -d Android/lib/debug/ --debug command, then inspect the generated .build/plugins/outputs/travel-posters-model/TravelPostersModel/destination/skipstone/TravelPostersModel/src/main/kotlin/travel/posters/model/ButtonStyle.kt file. Trace how the Swift enum's Double = 4 associated-value default is exported, and consider the export complete when the project assembles without the Kotlin type-mismatch error.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin, swift
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.