Xcode 10.1 “return” statement doesn't stop function execution [duplicate]early return from a void-func in Swift?Xcode 4 Error: Error Starting ExecutableXcode doesn't show code when stops at breakpointsUIScrollView Scrollable Content Size AmbiguitySwift Beta performance: sorting arraysSwift Parse - Method doesn't stop executingThe amount of Xcode tasks increase after every buildAdding localizable strings on xcode 10.1lldb-rpc-server in Xcode Version is 10.1?What's the solution for “error: Couldn't IRGen expression, no additional error” on Xcode 10.1?cloudkit disabled in capabilities after upgrade to xcode 10.1

How could a planet have erratic days?

Limits and Infinite Integration by Parts

15% tax on $7.5k earnings. Is that right?

A social experiment. What is the worst that can happen?

What is the highest possible scrabble score for placing a single tile

The probability of Bus A arriving before Bus B

Moving brute-force search to FPGA

How do you make your own symbol when Detexify fails?

Electoral considerations aside, what are potential benefits, for the US, of policy changes proposed by the tweet recognizing Golan annexation?

Do the primes contain an infinite almost arithmetic progression?

Can a Canadian Travel to the USA twice, less than 180 days each time?

Does an advisor owe his/her student anything? Will an advisor keep a PhD student only out of pity?

How can I write humor as character trait?

Sums of entire surjective functions

Hero deduces identity of a killer

Can the US President recognize Israel’s sovereignty over the Golan Heights for the USA or does that need an act of Congress?

Can I say "fingers" when referring to toes?

Calculating total slots

Is there a way to get `mathscr' with lower case letters in pdfLaTeX?

On a tidally locked planet, would time be quantized?

Terse Method to Swap Lowest for Highest?

How to hide some fields of struct in C?

What should you do if you miss a job interview (deliberately)?

Keeping a ball lost forever



Xcode 10.1 “return” statement doesn't stop function execution [duplicate]


early return from a void-func in Swift?Xcode 4 Error: Error Starting ExecutableXcode doesn't show code when stops at breakpointsUIScrollView Scrollable Content Size AmbiguitySwift Beta performance: sorting arraysSwift Parse - Method doesn't stop executingThe amount of Xcode tasks increase after every buildAdding localizable strings on xcode 10.1lldb-rpc-server in Xcode Version is 10.1?What's the solution for “error: Couldn't IRGen expression, no additional error” on Xcode 10.1?cloudkit disabled in capabilities after upgrade to xcode 10.1













1
















This question already has an answer here:



  • early return from a void-func in Swift?

    5 answers



The return statement in Xcode 10.1 is not honoured by debugger,



For eg.,



 func doSomething() 

print("Task A")
return

print("Task B")



This prints



Task A
Task B //This is not expected to be printed as we have a `return` before this line


Can someone help me!










share|improve this question













marked as duplicate by Martin R ios
Users with the  ios badge can single-handedly close ios questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
yesterday


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • That should not happen. Try a clean and rebuild. Sometimes Xcode loses its mind and does not rebuild your source files after you make changes.

    – Duncan C
    yesterday






  • 1





    @DuncanC: It does happen (see the linked-to Q&A). Swift executes the statement return print("Task B"), which prints the string and returns void. – Whether that should be considered a bug or not is a different story. Inserting a semicolon helps.

    – Martin R
    yesterday












  • @MartinR, well it's definitely not a bug, just a natural quirk of non-mandatory-semicolon syntax.

    – user28434
    yesterday















1
















This question already has an answer here:



  • early return from a void-func in Swift?

    5 answers



The return statement in Xcode 10.1 is not honoured by debugger,



For eg.,



 func doSomething() 

print("Task A")
return

print("Task B")



This prints



Task A
Task B //This is not expected to be printed as we have a `return` before this line


Can someone help me!










share|improve this question













marked as duplicate by Martin R ios
Users with the  ios badge can single-handedly close ios questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
yesterday


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















  • That should not happen. Try a clean and rebuild. Sometimes Xcode loses its mind and does not rebuild your source files after you make changes.

    – Duncan C
    yesterday






  • 1





    @DuncanC: It does happen (see the linked-to Q&A). Swift executes the statement return print("Task B"), which prints the string and returns void. – Whether that should be considered a bug or not is a different story. Inserting a semicolon helps.

    – Martin R
    yesterday












  • @MartinR, well it's definitely not a bug, just a natural quirk of non-mandatory-semicolon syntax.

    – user28434
    yesterday













1












1








1









This question already has an answer here:



  • early return from a void-func in Swift?

    5 answers



The return statement in Xcode 10.1 is not honoured by debugger,



For eg.,



 func doSomething() 

print("Task A")
return

print("Task B")



This prints



Task A
Task B //This is not expected to be printed as we have a `return` before this line


Can someone help me!










share|improve this question















This question already has an answer here:



  • early return from a void-func in Swift?

    5 answers



The return statement in Xcode 10.1 is not honoured by debugger,



For eg.,



 func doSomething() 

print("Task A")
return

print("Task B")



This prints



Task A
Task B //This is not expected to be printed as we have a `return` before this line


Can someone help me!





This question already has an answer here:



  • early return from a void-func in Swift?

    5 answers







ios swift xcode xcode10.1






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked yesterday









SaifSaif

1,2831923




1,2831923




marked as duplicate by Martin R ios
Users with the  ios badge can single-handedly close ios questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
yesterday


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Martin R ios
Users with the  ios badge can single-handedly close ios questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
yesterday


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • That should not happen. Try a clean and rebuild. Sometimes Xcode loses its mind and does not rebuild your source files after you make changes.

    – Duncan C
    yesterday






  • 1





    @DuncanC: It does happen (see the linked-to Q&A). Swift executes the statement return print("Task B"), which prints the string and returns void. – Whether that should be considered a bug or not is a different story. Inserting a semicolon helps.

    – Martin R
    yesterday












  • @MartinR, well it's definitely not a bug, just a natural quirk of non-mandatory-semicolon syntax.

    – user28434
    yesterday

















  • That should not happen. Try a clean and rebuild. Sometimes Xcode loses its mind and does not rebuild your source files after you make changes.

    – Duncan C
    yesterday






  • 1





    @DuncanC: It does happen (see the linked-to Q&A). Swift executes the statement return print("Task B"), which prints the string and returns void. – Whether that should be considered a bug or not is a different story. Inserting a semicolon helps.

    – Martin R
    yesterday












  • @MartinR, well it's definitely not a bug, just a natural quirk of non-mandatory-semicolon syntax.

    – user28434
    yesterday
















That should not happen. Try a clean and rebuild. Sometimes Xcode loses its mind and does not rebuild your source files after you make changes.

– Duncan C
yesterday





That should not happen. Try a clean and rebuild. Sometimes Xcode loses its mind and does not rebuild your source files after you make changes.

– Duncan C
yesterday




1




1





@DuncanC: It does happen (see the linked-to Q&A). Swift executes the statement return print("Task B"), which prints the string and returns void. – Whether that should be considered a bug or not is a different story. Inserting a semicolon helps.

– Martin R
yesterday






@DuncanC: It does happen (see the linked-to Q&A). Swift executes the statement return print("Task B"), which prints the string and returns void. – Whether that should be considered a bug or not is a different story. Inserting a semicolon helps.

– Martin R
yesterday














@MartinR, well it's definitely not a bug, just a natural quirk of non-mandatory-semicolon syntax.

– user28434
yesterday





@MartinR, well it's definitely not a bug, just a natural quirk of non-mandatory-semicolon syntax.

– user28434
yesterday












2 Answers
2






active

oldest

votes


















6














Because expression after return is treated as argument of return.

So your code understood by compiler as:



func doSomething() 
print("Task A")
return print("Task B")



To prevent it you can use semicolon to explicitly separate this expressions.

Like that:



func doSomething() 
print("Task A")
return;
print("Task B")






share|improve this answer


















  • 3





    ... as explained in stackoverflow.com/q/48887696/1187415 :)

    – Martin R
    yesterday












  • @MartinR yeah, I failed to find this question :D

    – ManWithBear
    yesterday


















-4














enter image description heretry this :



func doSomething() 


return print("Task A")

print("Task B")



the function itself does not wait for a value to get return, thats why in your case return wont stop the execution of the function,



but if your implement the return the way i showed above, it will return the print("task a") and will stop right away






share|improve this answer































    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    6














    Because expression after return is treated as argument of return.

    So your code understood by compiler as:



    func doSomething() 
    print("Task A")
    return print("Task B")



    To prevent it you can use semicolon to explicitly separate this expressions.

    Like that:



    func doSomething() 
    print("Task A")
    return;
    print("Task B")






    share|improve this answer


















    • 3





      ... as explained in stackoverflow.com/q/48887696/1187415 :)

      – Martin R
      yesterday












    • @MartinR yeah, I failed to find this question :D

      – ManWithBear
      yesterday















    6














    Because expression after return is treated as argument of return.

    So your code understood by compiler as:



    func doSomething() 
    print("Task A")
    return print("Task B")



    To prevent it you can use semicolon to explicitly separate this expressions.

    Like that:



    func doSomething() 
    print("Task A")
    return;
    print("Task B")






    share|improve this answer


















    • 3





      ... as explained in stackoverflow.com/q/48887696/1187415 :)

      – Martin R
      yesterday












    • @MartinR yeah, I failed to find this question :D

      – ManWithBear
      yesterday













    6












    6








    6







    Because expression after return is treated as argument of return.

    So your code understood by compiler as:



    func doSomething() 
    print("Task A")
    return print("Task B")



    To prevent it you can use semicolon to explicitly separate this expressions.

    Like that:



    func doSomething() 
    print("Task A")
    return;
    print("Task B")






    share|improve this answer













    Because expression after return is treated as argument of return.

    So your code understood by compiler as:



    func doSomething() 
    print("Task A")
    return print("Task B")



    To prevent it you can use semicolon to explicitly separate this expressions.

    Like that:



    func doSomething() 
    print("Task A")
    return;
    print("Task B")







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered yesterday









    ManWithBearManWithBear

    684519




    684519







    • 3





      ... as explained in stackoverflow.com/q/48887696/1187415 :)

      – Martin R
      yesterday












    • @MartinR yeah, I failed to find this question :D

      – ManWithBear
      yesterday












    • 3





      ... as explained in stackoverflow.com/q/48887696/1187415 :)

      – Martin R
      yesterday












    • @MartinR yeah, I failed to find this question :D

      – ManWithBear
      yesterday







    3




    3





    ... as explained in stackoverflow.com/q/48887696/1187415 :)

    – Martin R
    yesterday






    ... as explained in stackoverflow.com/q/48887696/1187415 :)

    – Martin R
    yesterday














    @MartinR yeah, I failed to find this question :D

    – ManWithBear
    yesterday





    @MartinR yeah, I failed to find this question :D

    – ManWithBear
    yesterday













    -4














    enter image description heretry this :



    func doSomething() 


    return print("Task A")

    print("Task B")



    the function itself does not wait for a value to get return, thats why in your case return wont stop the execution of the function,



    but if your implement the return the way i showed above, it will return the print("task a") and will stop right away






    share|improve this answer





























      -4














      enter image description heretry this :



      func doSomething() 


      return print("Task A")

      print("Task B")



      the function itself does not wait for a value to get return, thats why in your case return wont stop the execution of the function,



      but if your implement the return the way i showed above, it will return the print("task a") and will stop right away






      share|improve this answer



























        -4












        -4








        -4







        enter image description heretry this :



        func doSomething() 


        return print("Task A")

        print("Task B")



        the function itself does not wait for a value to get return, thats why in your case return wont stop the execution of the function,



        but if your implement the return the way i showed above, it will return the print("task a") and will stop right away






        share|improve this answer















        enter image description heretry this :



        func doSomething() 


        return print("Task A")

        print("Task B")



        the function itself does not wait for a value to get return, thats why in your case return wont stop the execution of the function,



        but if your implement the return the way i showed above, it will return the print("task a") and will stop right away







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited yesterday

























        answered yesterday









        Sanad BarjawiSanad Barjawi

        10711




        10711













            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현