$30 off During Our Annual Pro Sale. View Details »

Dartにおける静的解析 / FlutterKaigi 2022

hisaichi5518
November 17, 2022

Dartにおける静的解析 / FlutterKaigi 2022

hisaichi5518

November 17, 2022
Tweet

More Decks by hisaichi5518

Other Decks in Technology

Transcript

  1. ©︎ 2022 10X, Inc. %BSUʹ͓͚Δ੩తղੳ 1

  2. 2 ࣗݾ঺հ ©︎ 2022 10X, Inc. !IJTBJDIJ גࣜձࣾ9ιϑτ΢ΣΞΤϯδχΞ 'MVUUFS💙 OBUJWF@XFCWJFXMJOUJOH

  3. ©︎ 2022 10X, Inc. 3 ੩తղੳͬͯͳΜͩʁ

  4. 4 ੩తղੳͬͯͳΜͩʁ ©︎ 2022 10X, Inc. l੩తίʔυղੳ ͍͖ͤͯίʔυ͔͍͖ͤɺTUBUJDDPEFBOBMZTJT ·ͨ͸੩తϓϩ άϥϜղੳ

    TUBUJDQSPHSBNBOBMZTJT ͱ͸ɺίϯϐϡʔλͷιϑτ΢ΣΞͷղੳख ๏ͷҰछͰ͋Γɺ࣮ߦϑΝΠϧΛ࣮ߦ͢Δ͜ͱͳ͘ղੳΛߦ͏͜ͱɻz Ҿ༻ݩIUUQTKBXJLJQFEJBPSHXJLJ੩తίʔυղੳ
  5. 5 ղੳͬͯͳʹ͢Δͷʁ ©︎ 2022 10X, Inc. ίʔυͷՄಡੑΛԼ͛ͨΓόάΛੜΈ΍͘͢͢ΔͳͲͰආ͚Δ΂͖ίʔυͷॻ͖ํΛ ϧʔϧͱͯ࣋ͪ͠ɺϧʔϧʹ൓͢ΔίʔυͷൃݟͱܯࠂΛߦ͏ɻͦͯͦ͠ͷϧʔϧʹ ߹͏Α͏ʹࣗಈͰमਖ਼Ͱ͖ΔͳΒमਖ਼͢Δ ˞ࠓճͷεϥΠυͰͷఆٛ

  6. 6 ۩ମྫEBSUBOBMZ[F ©︎ 2022 10X, Inc.

  7. 7 ۩ମྫEBSU fi Y ©︎ 2022 10X, Inc.

  8. ©︎ 2022 10X, Inc. 8 9Ͱ͸ ੩తղੳΛͲ͏׆༻͍ͯ͠Δʁ

  9. 9 େલఏ fl VUUFSBOBMZ[FEBSUBOBMZ[F࢖ͬͯΔ ©︎ 2022 10X, Inc. ɾBOBMZTJT@PQUJPOTZBNMͰར༻͢ΔϧʔϧΛઃఆͰ͖Δ ɾݸͣͭϧʔϧΛࢦఆͰ͖Δ͕ɺϕετϓϥΫςΟεʹ৐Δͷ͕͍͍

    ɾ࠷ۙ͸ɺެࣜͰ fl VUUFS@MJOUT MJOUT͕͋Δ ɾ9Ͱ͸QFEBOUJDΛ࢖͍ͬͯΔɻ(PPHMF಺෦޲͚Ͱࠓ͸ඇਪ঑
  10. ©︎ 2022 10X, Inc. 10 ϧʔϧʹ൓͢Δίʔυͷൃݟͱܯࠂ Ͱಠࣗʹ΍͍ͬͯΔ͜ͱ

  11. 11 ϧʔϧʹ൓͢ΔίʔυͷൃݟͱܯࠂͰಠࣗʹ΍͍ͬͯΔ͜ͱ Ұ෦ ©︎ 2022 10X, Inc. ɾ 'MVUUFS ಛఆͷ৔ॴҎ֎Ͱ*NQPSUͯ͠΄͘͠ͳ͍ϑΝΠϧΛJNQPSU͍ͯ͠Δ৔߹ʹΤϥʔ

    ɾ 'MVUUFS ࣗલͰఆ͍ٛͯ͠Δ5FYU4UZMFҎ֎Λར༻͢ΔͱΤϥʔ ɾ αʔό 'JSFTUPSFͷ*/ΫΤϦʹม਺Λࢦఆͨ͠ΒΤϥʔ ɾ αʔό ςετ࣌ʹFYQFDU-BUFS͕ඞཁͳ࣌ʹFYQFDUΛར༻͍ͯ͠ΔͱΤϥʔ ˞9͸αʔόαΠυ΋%BSUͰ͢
  12. 12 ಛఆͷ৔ॴҎ֎Ͱ*NQPSUͯ͠΄͘͠ͳ͍ϑΝΠϧΛJNQPSU͍ͯ͠Δ৔߹ʹΤϥʔ ©︎ 2022 10X, Inc. ɾ9ఏڙΞϓϦ͸ɺ8FCͱϞόΠϧΞϓϦʹରԠ͍ͯ͠Δ ɾ8FCͰϏϧυ͢Δ࣌ͱϞόΠϧΞϓϦͰϏϧυ͢Δ࣌ͰಡΈࠐΈ͍ͨϑΝΠϧ͕ҧ͏ͷͰ BQQEBSUΛܦ༝ͯ͠JNQPSU͢ΔΑ͏ʹ͍ͯ͠Δ ɾXFC@BQQEBSU

    NPCJMF@BQQEBSUΛ௚઀JNQPSU͞ΕΔͷ͸ආ͚͍ͨ
  13. 13 ࣗલͰఆ͍ٛͯ͠Δ5FYU4UZMFҎ֎Λར༻͢ΔͱΤϥʔ ©︎ 2022 10X, Inc. ɾ9Ͱ͸ɺར༻͢Δ5FYU4UZMFΛ5FYU4UZMFTͱ͍͏Ϋϥεʹ·ͱΊͯఆ͍ٛͯ͠Δ ɾ։ൃऀ͕ࣗલͰ5FYU4UZMFΛఆٛͯ͠ར༻͢Δͷ͸ආ͚͍ͨ

  14. 14 'JSFTUPSFͷ*/ΫΤϦʹม਺Λࢦఆͨ͠ΒΤϥʔ ©︎ 2022 10X, Inc. ɾ'JSFTUPSF͸*/ΫΤϦʹ஋Λ࠷େݸ͔͠ࢦఆͰ͖ͳ੍͍ݶ͕͋Δɻݸࢦఆ͢Δͱ࣮ߦ࣌ ʹΤϥʔʹͳΔ ɾม਺Λ౉͍ͯ͠Δͱ։ൃ؀ڥͰ͸ؾ෇͚ͣຊ൪ͰΤϥʔʹͳΔ͜ͱ͕͋ΔͷͰආ͚͍ͨ

  15. 15 'JSFTUPSFͷ*/ΫΤϦʹม਺Λࢦఆͨ͠ΒΤϥʔ ©︎ 2022 10X, Inc. ɾ഑ྻΛͦͷ··౉ͤ͹ΤϥʔʹͳΒͳ͍Α͏ʹ͍ͯ͠Δ ɾݸ਺·Ͱ͸਺͑ͯͳ͍

  16. 16 ςετ࣌ʹFYQFDU-BUFS͕ඞཁͳ࣌ʹFYQFDUΛར༻͍ͯ͠ΔͱΤϥʔ ©︎ 2022 10X, Inc. ɾςετ࣌ʹFYQFDUʹ'VUVSFʜΛ౉͢ͱBXBJU͞Εͣɺ࣍ͷߦͷॲཧʹҠͬͯ͠·͏ͷͰආ ͚͍ͨ

  17. ©︎ 2022 10X, Inc. 17 ͲͷΑ͏ʹ࣮૷͔ͨ͠ʁ

  18. 18 લఏEBSUBOBMZ[FͱEBSU fi Yͷ՝୊ ©︎ 2022 10X, Inc. ɾ%BSUʹ͸ɺEBSUBOBMZ[FͱEBSU fi

    Y͕͋Δ ɾ͔͠͠EBSUBOBMZ[F΍EBSU fi Yʹ͸։ൃऀ͕ಠࣗϧʔϧΛఆٛ͢Δ࢓૊Έ͕·ͩͳ͍ ɾͳͷͰɺಠࣗϧʔϧΛ࡞੒͍ͨ͠৔߹͸։ൃऀ͕EBSUBOBMZ[FͱEBSU fi Yͱಉ͡Α͏ͳ࣮૷Λ ࣗલͰ࣮૷͢Δඞཁ͕͋Δ IUUQTHJUIVCDPNEBSUMBOHMJOUFSJTTVFT
  19. 19 $-*ίϚϯυฤ ©︎ 2022 10X, Inc. ɾ%BSU4%,ʹؚ·ΕΔMJOUFSQBDLBHFΛ࢖͑͹͙࣮͢૷Ͱ͖Δ ɾϧʔϧͷॻ͖ํ͸MJOUFSʹ͋Δϧʔϧͷ࣮૷ΛಡΊ͹0, ɾIUUQTHJUIVCDPNEBSUMBOHMJOUFS ϝϦοτ

    w*%&্ʹࢦఠ಺༰Λදࣔ͢Δ͜ͱ͕Ͱ͖ͳ͍ wར༻͢Δͷ͸MJOUFSͷެ։͞Εͨ"1*Ͱ͸ͳ͍ͷͰյΕΔ͔΋͠Εͳ͍ σϝϦοτ
  20. 20 $-*ίϚϯυ࣮૷ྫ ©︎ 2022 10X, Inc.

  21. 21 $-*ίϚϯυ࣮ߦྫ ©︎ 2022 10X, Inc.

  22. 22 ࣮ࡍ࡞ͬͯΈͯ ©︎ 2022 10X, Inc. ɾ͙͢࡞Εͯศརʂ ɾίϚϯυ͕͋Δͬͯ͜ͱ͸(JUIVC"DUJPOTͳͲ$*্Ͱ΋ಈ͔ͤΔͷͰศར ɾ͚Ͳ։ൃͯ͠Δͱ͖ʹ*%&্Ͱࢦఠ͞Εͳ͍ͱؾͮ͘ͷʹ஗Εͯ։ൃମݧ͕ྑ͍ͱ͸ݴ͑ͳ͍

  23. 23 BOBMZ[FSQMVHJOฤ ©︎ 2022 10X, Inc. w*%&্ʹࢦఠ಺༰Λදࣔ͢Δ͜ͱ͕Ͱ͖Δ ϝϦοτ w࣮૷͢Δྔ͕ଟ͍͠σόοά͕େม $-*ίϚϯυ΋ࣗલͰ࡞Δඞཁ͋Γ

     wϧʔϧͷఆٛ͸ࣗલ࣮૷ͳͷͰɺ͋·ΓࢀߟʹͳΒͳ͍͔΋ σϝϦοτ
  24. 24 BOBMZ[FSQMVHJOͰ࣮૷͢Δඞཁ͕͋Δ΋ͷ ©︎ 2022 10X, Inc. ɾϧʔϧʹҧ൓͢Δ͔ݕূ͢Δ໾ "OBMZ[FS  ɾҧ൓ͨ͠ίʔυͷܯࠂ͢Δ໾

    3FQPSUFS  ɾ"OBMZ[FSͱ3FQPSUFSΛ·ͱΊΔ໾ "OBMZ[F$PNNBOE  ɾBOBMZ[FSQMVHJO͔Βݺͼग़͞Εͯ"OBMZ[F$PNNBOEΛ࣮ߦ͢Δ໾ "OBMZ[FS1MVHJO  ɾ$-*ίϚϯυ͔Βݺͼग़͞Εͯ"OBMZ[F$PNNBOEΛ࣮ߦ͢Δ໾ $MJ3VOOFS
  25. 25 BOBMZ[FSQMVHJOฤ࣮૷ྫ ©︎ 2022 10X, Inc. -JOUJOH͸ͦΕΒͷ࣮૷Λ༻ҙ͍ͯ͠ΔͷͰݺͼग़͚ͩ͢ IUUQTQVCEFWQBDLBHFTMJOUJOH

  26. 26 ࣮ࡍ࡞ͬͯΈͯ ©︎ 2022 10X, Inc. ɾ*%&্ʹࢦఠ಺༰͕දࣔ͞ΕΔͷͰ͙͢ؾ͚ͮͯศར ɾ࣮ͨͩ૷ͱ"OBMZ[FS1MVHJOͷσόοά͕େม ɾͱΓ͋͑ͣಈ͘ܗʹ͢ΔͷͰिؒɺϦϑΝΫλϦϯάͯ͠ʴिؒ͘Β͍

  27. 27 BOBMZ[FSQMVHJO͕ಈ͍͍ͯͳ͍͔΋͠Εͳ͍࣌ͷσόοάςΫ ©︎ 2022 10X, Inc. ɾFYFDVUJPOQBUIͷத਎͸ɺ૝ఆ͍ͯͨ͠಺༰ʹͳ͍ͬͯΔ͔ ɾ)0.&EBSU4FSWFSQMVHJO@NBOBHFSͷQMVHJOEBSUΛ࣮ߦͯ͠ΈͯΤϥʔʹͳΔ͔֬ ೝ ɾ"OBMZ[FSQMVHJOͰ%FCVHHFSΛ࢖͏

    ΍Γํ͕ਖ਼͍͔͠͸ඍົ
  28. 28 ·ͣɺجຊ ©︎ 2022 10X, Inc. ɾ*OUFMJ+Λ࢖͍·͢ ɾ%BSU"OBMZUJDTλϒʹҠಈͯ͠ࣃंΛΫϦοΫ͢Δ ͱl7JFXBOBMZ[FSEJBHOPTUJDTzͱ͍͏ͷ͕ग़ΔͷͰ ΫϦοΫ

    ɾ"OBMZTJT4FSWFS%JBHOPTUJDT্ཱ͕͕ͪΔͷͰɺ 1MVHJOTλϒʹҠಈ ɾࠨͷঢ়ଶͩͬͨΒਖ਼͘͠ಈ͍͍ͯΔ
  29. 29 FYFDVUJPOQBUIͷத਎͸ɺ૝ఆ͍ͯͨ͠಺༰ʹͳ͍ͬͯΔ͔ ©︎ 2022 10X, Inc. ͓͔͍࣌͠͸ϑΝΠϧΛফ͢ͱ௚Δ

  30. 30 )0.&EBSU4FSWFSQMVHJO@NBOBHFSͷQMVHJOEBSUΛ࣮ߦͯ͠ΈͯΤϥʔʹͳΔ͔֬ೝ ©︎ 2022 10X, Inc. ΤϥʔʹͳͬͯΔ࣌͸ͳ͓͢

  31. 31 "OBMZ[FSQMVHJOͰ%FCVHHFSΛ࢖͏ ©︎ 2022 10X, Inc. ͜ͷυΩϡϝϯτ͕ৄ͍͠ʂ IUUQTHJUIVCDPN8PSLJWBPWFS@SFBDUUSFF NBTUFSUPPMTBOBMZ[FS@QMVHJOEFCVHHJOHUIF QMVHJO

  32. 32 ݱঢ়ͱࠓޙ ©︎ 2022 10X, Inc. ɾ-JOUJOHͱ͍͏ύοέʔδΛ࡞ͬͯ9Ͱ͸ར༻͍ͯ͠Δ ɾJOWFSUBTF͔ΒDVTUPN@MJOUͱ͍͏ύοέʔδ͕೥݄ʹग़ͨ ɾ͜Ε΋MJOUJOHಉ༷؆୯ʹBOBMZ[FSQMVHJOΛ࡞ΕΔ ɾ9Ͱ͸MJOUJOHΛ΍ΊͯDVTUPN@MJOUʹҠߦ͢Δ༧ఆ

    ɾͳͷͰMJOUJOHͰ͸ͳ͘DVTUPN@MJOUΛ࢖ͬͯͶ
  33. ©︎ 2022 10X, Inc. 33 ίʔυͷॻ͖׵͑

  34. 34 1SPWJEFS͔Β3JWFSQPE΁ͷஔ͖׵͑ ©︎ 2022 10X, Inc. ɾ೥݄ࠒɺ1SPWJEFS͔Β3JWFSQPEʹҠߦ͍ͨ͠ ɾͪ·ͪ·มߋ͢Δͷ͸େมͳͷͰҰؾʹஔ͖׵͍͑ͨ ɾ੩తղੳͰ1SPWJEFS͔Β3JWFSQPEʹҰؾʹஔ͖׵͑Δͧʂ

  35. ©︎ 2022 10X, Inc. 35 ͲͷΑ͏ʹ࣮૷͔ͨ͠ʁ

  36. 36 EBSU@DPEFNPE ©︎ 2022 10X, Inc. ɾϧʔϧʹϚον͢Δίʔυͷॻ͖׵͕͑ग़དྷΔศརύοέʔδ ɾ"45ɺਖ਼نදݱΛॻ͖׵͑ͷ৚݅ʹग़དྷΔ ɾIUUQTQVCEFWQBDLBHFTDPEFNPE ɾSJWFSQPEͰ΋3JWFSQPEYܥ͔ΒYܥ΁ͷஔ͖׵͑΋DPEFNPEΛ࢖࣮ͬͯ૷͞Ε͍ͯΔ

  37. 37 EBSU@DPEFNPEͷ࣮ྫ ©︎ 2022 10X, Inc.

  38. 38 ࣮ࡍ࡞ͬͯΈͯ ©︎ 2022 10X, Inc. ɾDPEFNPEͰίʔυΛॻ͖׵͑Δͷ͸؆୯ʹͰ͖ͯศར ɾϏϧυ͕ग़དྷΔͱ͜Ζ·Ͱ͸ग़དྷ͚ͨͲɺಈ͖͕ෆԺͩͬͨͷͰϚʔδ͸͠ͳ͔ͬͨ ɾҰؾʹஔ͖׵͑Δʹ͸ɺ࡞ΓࠐΉඞཁ͕͋Δ ɾͪΌΜͱ΍ΔͳΒখ࣮͘͞૷ͯ͠খ࣮͘͞ߦ͍ͯ͘͠ͷ͕Α͔ͬͨ

    ɾࠓ͸ۀ຿ҕୗͷਓʹख఻ͬͯ΋ΒͬͯखಈͰઈࢍҠߦத
  39. ©︎ 2022 10X, Inc. 39 ·ͱΊ

  40. 40 ·ͱΊ ©︎ 2022 10X, Inc. ɾ੩తղੳΛ࢖͑͹ίʔυͷϧʔϧҧ൓Λݟ͚ͭͨΓमਖ਼ग़དྷͯศརʂϦ ϑΝΫλϦϯάʹ΋࢖͑Δ ɾEBSUBOBMZ[FͱEBSU fi

    Y͸ΧελϜϧʔϧ͕ར༻Ͱ͖ͳ͍ͷͰಠࣗϧʔϧ Λఆ͍ٛͨ͠ͳΒࣗલͰ࣮૷͢Δඞཁ͕͋Δ ɾϧʔϧҧ൓Λݟ͚ͭΔͨΊͷ࣮૷͸DVTUPN@MJOUΛ࢖͑͹ָʹ࣮૷Ͱ͖Δ ɾBOBMZ[FSQMVHJO͸MJOUJOH͕ࢀߟʹͳΔ͔΋ ɾίʔυͷॻ͖׵͑ͷ࣮૷͸DPEFNPEΛ࢖͑͹ָʹ࣮૷Ͱ͖Δ ɾҰؾʹ΍Δͷ͸େมͳͷͰখ࣮͘͞૷ɺ࣮ߦɺվળ͍ͯ͘͠ͷ͕ྑͦ͞ ͏
  41. 41 ͋Γ͕ͱ͏͍͟͝·ͨ͠ ©︎ 2022 10X, Inc.