skiptools / skiptools/skip

JSONSerialization.jsonObject may have a different behavior when using SkipFuse, a crash occurs

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

Nobody has claimed this yet.

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

Description

Hi, trying to run a library using SkipFuse having a JSONSerialization.jsonObject call and casting to any Sendable & Hashable, I get different behavior on iOS and Android. On iOS everything works, but on Android it crashes

import Foundation

var d = """
    {"test":{"test":1}}
    """.data(using: .utf8)

public typealias JSONTestValue = any Sendable & Hashable

let f = try JSONSerialization.jsonObject(with: d!, options: [])
let g = f as! JSONTestValue
Could not cast value of type 'Swift.Dictionary<Swift.String, Any>' (0xb400006ff7905358) to 'Swift.Hashable' (0xb400006ff7905390).
Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 24845

Perhaps of course it's not Skip, but Swift...

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

Start by reproducing the provided Swift example with SkipFuse on both iOS and Android, focusing on JSONSerialization.jsonObject and the any Sendable & Hashable cast. Compare the resulting runtime types and trace whether the discrepancy comes from SkipFuse or the platform behavior. Done means the cause is identified and the crash or its expected behavior is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, ios, swift
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.